Skip to content

Commit e2491f1

Browse files
committed
reformat code
1 parent c6a1bb1 commit e2491f1

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/ConversionEngine.mm

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ - (void)initSubstitutionDatabase {
9494
}
9595

9696
- (NSDictionary *)loadSubstitutionsFromDB {
97-
if (!_subDbQueue) return @{};
97+
if (!_subDbQueue)
98+
return @{};
9899

99100
// migrate legacy JSON file to SQLite on first launch
100101
NSString *jsonPath = [NSString stringWithFormat:@"%@/.you_expand_me.json", NSHomeDirectory()];
@@ -122,7 +123,8 @@ - (NSDictionary *)loadSubstitutionsFromDB {
122123
}
123124

124125
- (NSDictionary *)allSubstitutions {
125-
if (!_subDbQueue) return @{};
126+
if (!_subDbQueue)
127+
return @{};
126128
__block NSMutableDictionary *dict = [NSMutableDictionary dictionary];
127129
[_subDbQueue inDatabase:^(FMDatabase *db) {
128130
FMResultSet *rs = [db executeQuery:@"SELECT key, value FROM substitutions"];
@@ -134,7 +136,8 @@ - (NSDictionary *)allSubstitutions {
134136
}
135137

136138
- (void)addSubstitution:(NSString *)key value:(NSString *)value {
137-
if (!_subDbQueue) return;
139+
if (!_subDbQueue)
140+
return;
138141
[_subDbQueue inDatabase:^(FMDatabase *db) {
139142
[db executeUpdate:@"INSERT OR REPLACE INTO substitutions (key, value) VALUES (?, ?)", key, value];
140143
}];
@@ -143,7 +146,8 @@ - (void)addSubstitution:(NSString *)key value:(NSString *)value {
143146
}
144147

145148
- (void)removeSubstitution:(NSString *)key {
146-
if (!_subDbQueue) return;
149+
if (!_subDbQueue)
150+
return;
147151
[_subDbQueue inDatabase:^(FMDatabase *db) {
148152
[db executeUpdate:@"DELETE FROM substitutions WHERE key = ?", key];
149153
}];

src/WebServer.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ - (void)start {
8787
}];
8888

8989
[webServer addHandlerForMethod:@"DELETE"
90-
pathRegex:@"/substitutions/(.+)"
90+
pathRegex:@"/substitutions/(.+)"
9191
requestClass:[GCDWebServerRequest class]
9292
processBlock:^GCDWebServerResponse *(GCDWebServerRequest *request) {
9393
NSArray *captures = [request attributeForKey:GCDWebServerRequestAttribute_RegexCaptures];

0 commit comments

Comments
 (0)