PackageWriterImpl::_AttributeRemoved(): Update string cache

When removing a string attribute, decrement the referenced string's
usage count in the string cache. This fixes the potentially incorrect
usage counts in update mode. Not a serious problem, but it could lead
to only singly (or no longer) used strings to be written to the string
subsection instead of encoding them inline and thus to slightly greater
file sizes.
This commit is contained in:
Ingo Weinhold
2013-10-25 22:54:44 +02:00
parent c9ed1ea292
commit 3f40dcb6b4
3 changed files with 20 additions and 7 deletions
+5 -5
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Copyright 2009-2013, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef _PACKAGE__HPKG__PRIVATE__STRINGS_H_
@@ -89,11 +89,11 @@ struct CachedStringUsageGreater {
struct StringCache : public CachedStringTable {
StringCache();
~StringCache();
CachedString* Get(const char* value);
StringCache();
~StringCache();
CachedString* Get(const char* value);
void Put(CachedString* string);
};