From 4c27dab1522f025f39f0ce0ab49830f0b544e34a Mon Sep 17 00:00:00 2001 From: pixel Date: Wed, 5 Jan 2005 19:37:05 +0000 Subject: Optimizing operator== a bit. --- lib/String.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') 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 #include @@ -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); } -- cgit v1.2.3