Remove some duplicate code.
authorPeng Huang <shawn.p.huang@gmail.com>
Mon, 4 Jan 2010 01:33:52 +0000 (09:33 +0800)
committerPeng Huang <shawn.p.huang@gmail.com>
Mon, 4 Jan 2010 01:33:52 +0000 (09:33 +0800)
src/Database.cc

index a5f78f9..d214654 100644 (file)
@@ -78,12 +78,12 @@ Database::init (void)
 
     m_sql.erase (0);
 
-#if 0
+#if 1
     /* Set synchronous=OFF, write user database will become much faster.
-     * It will cause user database corrupted,
-     * if the operatering system crashes or computer loses power.
+     * It will cause user database corrupted, if the operatering system
+     * crashes or computer loses power.
      * */
-    m_sql << "PRAGMA synchronous=OFF;\n";
+    m_sql << "PRAGMA synchronous=NORMAL;\n";
 #endif
 
     /* Set the cache size for better performance */
@@ -95,9 +95,6 @@ Database::init (void)
     /* Set journal mode */
     m_sql << "PRAGMA journal_mode=TRUNCATE;\n";
 
-    /* Set the sync mode */
-    m_sql << "PRAGMA synchronous=NORMAL;\n";
-
     /* Using EXCLUSIVE locking mode on main database
      * for better performance */
     m_sql << "PRAGMA main.locking_mode=EXCLUSIVE;\n";