From 467e6b2b97f496a33fc2908e18a420330226503e Mon Sep 17 00:00:00 2001 From: "darin%meer.net" Date: Fri, 7 Oct 2005 21:52:18 +0000 Subject: [PATCH] fixes bug 311456 "Calling Truncate() on an nsAutoString makes next append work hard" r+sr=bzbarsky git-svn-id: svn://10.0.0.236/trunk@181788 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/string/src/nsTSubstring.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mozilla/xpcom/string/src/nsTSubstring.cpp b/mozilla/xpcom/string/src/nsTSubstring.cpp index 1eb89b2de3b..bee1873f554 100644 --- a/mozilla/xpcom/string/src/nsTSubstring.cpp +++ b/mozilla/xpcom/string/src/nsTSubstring.cpp @@ -542,6 +542,9 @@ nsTSubstring_CharT::SetCapacity( size_type capacity ) void nsTSubstring_CharT::SetLength( size_type length ) { + if (mLength == length) + return; + SetCapacity(length); // XXX(darin): SetCapacity may fail, but it doesn't give us a way to find