Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ccgus committed May 12, 2012
1 parent 78784e3 commit 46614e2
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions src/FMDatabase.m
Original file line number Diff line number Diff line change
Expand Up @@ -289,19 +289,14 @@ - (int)lastErrorCode {
}


-(NSError*)errorWithMessage:( NSString* )message_
{
NSDictionary* errorMessage_ = [ NSDictionary dictionaryWithObject: message_
forKey: NSLocalizedDescriptionKey];

return [NSError errorWithDomain:@"FMDatabase"
code:sqlite3_errcode(_db)
userInfo:errorMessage_];
- (NSError*)errorWithMessage:(NSString*)message {
NSDictionary* errorMessage = [NSDictionary dictionaryWithObject:message forKey:NSLocalizedDescriptionKey];

return [NSError errorWithDomain:@"FMDatabase" code:sqlite3_errcode(_db) userInfo:errorMessage];
}

-(NSError*)lastError
{
return [ self errorWithMessage: [ self lastErrorMessage ] ];
- (NSError*)lastError {
return [self errorWithMessage:[self lastErrorMessage]];
}

- (sqlite_int64)lastInsertRowId {
Expand Down Expand Up @@ -737,10 +732,7 @@ - (BOOL)executeUpdate:(NSString*)sql error:(NSError**)outErr withArgumentsInArra
sqlite3_finalize(pStmt);

if (outErr) {



*outErr = [ self errorWithMessage: [NSString stringWithUTF8String:sqlite3_errmsg(_db)] ];
*outErr = [self errorWithMessage:[NSString stringWithUTF8String:sqlite3_errmsg(_db)]];
}

_isExecutingStatement = NO;
Expand Down

0 comments on commit 46614e2

Please sign in to comment.