clear() is better than resize(0)
committer: Markus Bröker <mbroeker@largo.homelinux.org>
--- 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;
};