summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorpixel <pixel>2005-01-05 19:37:05 +0000
committerpixel <pixel>2005-01-05 19:37:05 +0000
commit4c27dab1522f025f39f0ce0ab49830f0b544e34a (patch)
treeaf6829ca3ef30efdb03aecf3195f70fa3ef4d31b /lib
parent8d1453a4662d99d44d200b174d241ab78c044abf (diff)
Optimizing operator== a bit.
Diffstat (limited to 'lib')
-rw-r--r--lib/String.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/String.cc b/lib/String.cc
index 084831c..08af9ab 100644
--- a/lib/String.cc
+++ b/lib/String.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: String.cc,v 1.36 2004-11-27 21:46:04 pixel Exp $ */
+/* $Id: String.cc,v 1.37 2005-01-05 19:37:05 pixel Exp $ */
#include <stdio.h>
#include <string.h>
@@ -344,6 +344,8 @@ bool String::operator!=(const String & s) const {
}
bool String::operator==(const String & s) const {
+ if (siz != s.siz)
+ return false;
return (strcmp(str, s.str) == 0);
}