From 3f13eb89f1ab4a25296e4ea07f79e5a2823efd71 Mon Sep 17 00:00:00 2001 From: castano Date: Wed, 22 Oct 2008 05:31:28 +0000 Subject: [PATCH] Merge fixes from trunk. --- src/nvcore/StrLib.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/nvcore/StrLib.h b/src/nvcore/StrLib.h index 95d5cf4..f193304 100644 --- a/src/nvcore/StrLib.h +++ b/src/nvcore/StrLib.h @@ -14,7 +14,7 @@ namespace nv uint strHash(const char * str, uint h) NV_PURE; - /// String hash vased on Bernstein's hash. + /// String hash based on Bernstein's hash. inline uint strHash(const char * data, uint h = 5381) { uint i; @@ -213,9 +213,12 @@ namespace nv /// Implement value semantics. String & operator=( const String & str ) { - release(); - data = str.data; - addRef(); + if (str.data != data) + { + release(); + data = str.data; + addRef(); + } return *this; }