From: blackh <gra...@li...> - 2003-08-27 11:10:39
|
blackh Wed Aug 27 04:08:44 2003 EDT Modified files: /grapevine Makefile.in /grapevine/cpp Object.cpp Object.h Log: Yet another performance improvement. Index: grapevine/cpp/Object.h diff -u grapevine/cpp/Object.h:1.28 grapevine/cpp/Object.h:1.29 --- grapevine/cpp/Object.h:1.28 Wed Aug 27 03:25:32 2003 +++ grapevine/cpp/Object.h Wed Aug 27 04:08:43 2003 @@ -1,4 +1,4 @@ -// $Id: Object.h,v 1.28 2003/08/27 10:25:32 blackh Exp $ +// $Id: Object.h,v 1.29 2003/08/27 11:08:43 blackh Exp $ #ifndef _OBJECT_H_ #define _OBJECT_H_ @@ -251,8 +251,19 @@ * Get the characters of this string. If this string is lazy, then * it may pull the text in from the database. */ - inline const char* getUTF8Chars() const; - int getUTF8Length() const; + inline const char* getUTF8Chars() const + { + if (lazyInfo != NULL) + getUTF8CharsRetrieve(); + return text__; + } + + inline int getUTF8Length() const + { + if (length__ < 0) + getUTF8LengthRetrieve(); + return length__; + } void getUnicodeChars(Char chars[]) const; int getUnicodeLength() const; @@ -268,6 +279,9 @@ static void purgeOldestStrings(); private: + void getUTF8CharsRetrieve() const; + void getUTF8LengthRetrieve() const; + int compare(const ObjectImpl& other) const; int unicodeToUTF8Index(int unicodeIndex, bool strict) const; int retrieve_(); |