Skip to content

Commit

Permalink
[sqflite] fix issue #1115 typo
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Jun 27, 2024
1 parent 2de3e1f commit ee2bdf6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions sqflite/darwin/Classes/SqfliteDatabase.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ - (void)dbHandleError:(SqfliteDarwinDatabase*)db operation:(SqfliteOperation*)op
}

- (void)dbRunQueuedOperations:(SqfliteDarwinDatabase*)db {
while (![SqflitePlugin arrayIsEmpy:noTransactionOperationQueue]) {
while (![SqflitePlugin arrayIsEmpty:noTransactionOperationQueue]) {
if (currentTransactionId != nil) {
break;
}
Expand All @@ -86,7 +86,7 @@ - (void)wrapSqlOperationHandler:(SqfliteDarwinDatabase*)db operation:(SqfliteOpe
handler(db, operation);
} else if (transactionId != nil && (transactionId.intValue == currentTransactionId.intValue || transactionId.intValue == transactionIdForce)) {
handler(db, operation);
if (currentTransactionId == nil && ![SqflitePlugin arrayIsEmpy:noTransactionOperationQueue]) {
if (currentTransactionId == nil && ![SqflitePlugin arrayIsEmpty:noTransactionOperationQueue]) {
[self dbRunQueuedOperations:db];
}
} else {
Expand Down Expand Up @@ -147,7 +147,7 @@ - (bool)dbExecuteOrError:(SqfliteDarwinDatabase*)db operation:(SqfliteOperation*
sqlite3_db_config(db.sqliteHandle, SQLITE_DBCONFIG_DEFENSIVE, 0, 0);
}

BOOL argumentsEmpty = [SqflitePlugin arrayIsEmpy:sqlArguments];
BOOL argumentsEmpty = [SqflitePlugin arrayIsEmpty:sqlArguments];
if (sqfliteHasSqlLogLevel(logLevel)) {
NSLog(@"%@ %@", sql, argumentsEmpty ? @"" : sqlArguments);
}
Expand Down Expand Up @@ -251,7 +251,7 @@ - (void)dbQuery:(SqfliteDarwinDatabase*)db operation:(SqfliteOperation*)operatio
- (bool)dbDoQuery:(SqfliteDarwinDatabase*)db operation:(SqfliteOperation*)operation {
NSString* sql = [operation getSql];
NSArray* sqlArguments = [operation getSqlArguments];
bool argumentsEmpty = [SqflitePlugin arrayIsEmpy:sqlArguments];
bool argumentsEmpty = [SqflitePlugin arrayIsEmpty:sqlArguments];
// Non null means use a cursor
NSNumber* cursorPageSize = [operation getArgument:_paramCursorPageSize];

Expand Down
2 changes: 1 addition & 1 deletion sqflite/darwin/Classes/SqflitePlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@interface SqflitePlugin : NSObject<FlutterPlugin>

+ (NSArray*)toSqlArguments:(NSArray*)rawArguments;
+ (bool)arrayIsEmpy:(NSArray*)array;
+ (bool)arrayIsEmpty:(NSArray*)array;
+ (NSMutableDictionary*)resultSetToResults:(SqfliteDarwinResultSet*)resultSet cursorPageSize:(NSNumber*)cursorPageSize;

@end
Expand Down
6 changes: 3 additions & 3 deletions sqflite/darwin/Classes/SqflitePlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@ + (NSObject*)fromSqlValue:(NSObject*)sqlValue {
}
}

+ (bool)arrayIsEmpy:(NSArray*)array {
+ (bool)arrayIsEmpty:(NSArray*)array {
return (array == nil || array == (id)[NSNull null] || [array count] == 0);
}

+ (NSArray*)toSqlArguments:(NSArray*)rawArguments {
NSMutableArray* array = [NSMutableArray new];
if (![SqflitePlugin arrayIsEmpy:rawArguments]) {
if (![SqflitePlugin arrayIsEmpty:rawArguments]) {
for (int i = 0; i < [rawArguments count]; i++) {
[array addObject:[SqflitePlugin toSqlValue:[rawArguments objectAtIndex:i]]];
}
Expand Down Expand Up @@ -325,7 +325,7 @@ + (NSMutableDictionary*)resultSetToResults:(SqfliteDarwinResultSet*)resultSet cu
- (bool)query:(SqfliteDatabase*)database fmdb:(SqfliteDarwinDatabase*)db operation:(SqfliteOperation*)operation {
NSString* sql = [operation getSql];
NSArray* sqlArguments = [operation getSqlArguments];
bool argumentsEmpty = [SqflitePlugin arrayIsEmpy:sqlArguments];
bool argumentsEmpty = [SqflitePlugin arrayIsEmpty:sqlArguments];
// Non null means use a cursor
NSNumber* cursorPageSize = [operation getArgument:_paramCursorPageSize];

Expand Down

0 comments on commit ee2bdf6

Please sign in to comment.