OSDN Git Service

[core] :
authorcaprice <caprice@users.sourceforge.jp>
Sat, 10 Aug 2013 15:24:23 +0000 (00:24 +0900)
committercaprice <caprice@users.sourceforge.jp>
Sat, 10 Aug 2013 15:24:23 +0000 (00:24 +0900)
* open(), run_sql() - 明らかにいらない条件比較を削除

core/include/database.hpp

index 795517d..cf861f8 100644 (file)
@@ -55,8 +55,7 @@ public:
      *       compile_sql() を用いるべきである。
      */
     bool run_sql(const mona_string& sql) {
-        return (::sqlite3_exec(db, sql.c_str(), NULL, NULL, NULL) != SQLITE_OK)
-            ? false : true;
+        return (::sqlite3_exec(db, sql.c_str(), NULL, NULL, NULL) != SQLITE_OK);
     }
     
     /// @brief 受け取った SQL を sql_executer へと変換して返す。
@@ -101,9 +100,7 @@ public:
             return is_opened_db;
         }
         
-        is_opened_db =
-            (::sqlite3_open(db_path.c_str(), &db) != SQLITE_OK)
-                ? false : true;
+        is_opened_db = (::sqlite3_open(db_path.c_str(), &db) != SQLITE_OK);
         
         return is_opened_db;
     }