clear() is better than resize(0)
authorMarkus Bröker <mbroeker@largo.dyndns.tv>
Sat, 13 Dec 2008 17:58:06 +0100
changeset 13 2640a7fd96ca
parent 12 9f0ce4eaa1ce
child 14 862d63715611
clear() is better than resize(0) committer: Markus Bröker <mbroeker@largo.homelinux.org>
bad_alloc.cc
db_bridge/include/abstract_db.h
--- a/bad_alloc.cc
+++ b/bad_alloc.cc
@@ -19,6 +19,7 @@
     rlim.rlim_max = 1.25 * megs;
     if (megs > (4 * 1024 * 1024))
         return setrlimit (RLIMIT_AS, &rlim);
+
     return EXIT_FAILURE;
 }
 
@@ -41,7 +42,7 @@
         cout << e.what () << " after " << i << " iterations" << endl << endl;
         cout << "Would you like to see the full error message? (y/n) ";
         cin >> action;
-		v.resize(0);
+        v.clear();
         switch (action) {
         case 'y':
             throw;
--- a/db_bridge/include/abstract_db.h
+++ b/db_bridge/include/abstract_db.h
@@ -17,8 +17,7 @@
     std::string server;
 
   public:
-    virtual ~ Abstract_DB () {
-    };
+    virtual ~ Abstract_DB () {}
     virtual bool connect () = 0;
     virtual std::vector < std::vector<std::string> >query (std::string) = 0;
 };