Commit d80c654b authored by Sebastian Ramacher's avatar Sebastian Ramacher

Merge two ifs

parent 155e538d
......@@ -463,14 +463,11 @@ plain_remove_bookmark(zathura_database_t* db, const char* file, const char* id)
}
char* name = prepare_filename(file);
if (g_key_file_has_group(priv->bookmarks, name) == TRUE) {
if (g_key_file_remove_key(priv->bookmarks, name, id, NULL) == TRUE) {
zathura_db_write_key_file_to_file(priv->bookmark_path, priv->bookmarks);
g_free(name);
if (g_key_file_has_group(priv->bookmarks, name) == TRUE && g_key_file_remove_key(priv->bookmarks, name, id, NULL) == TRUE) {
zathura_db_write_key_file_to_file(priv->bookmark_path, priv->bookmarks);
g_free(name);
return true;
}
return true;
}
g_free(name);
......
......@@ -155,11 +155,10 @@ check_column_type(sqlite3* session, const char* table, const char* col, const ch
*res = false;
while (sqlite3_step(stmt) == SQLITE_ROW) {
if (strcmp((const char*) sqlite3_column_text(stmt, 1), col) == 0) {
if (strcmp((const char*) sqlite3_column_text(stmt, 2), type) == 0) {
*res = true;
break;
}
if (strcmp((const char*) sqlite3_column_text(stmt, 1), col) == 0 &&
strcmp((const char*) sqlite3_column_text(stmt, 2), type) == 0) {
*res = true;
break;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment