If the normalized version of a name is the same as the raw version, it
may already be the case that the normalize() method returned the same String, but if not, ensure that we're only holding on to one of those Strings. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4297 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -60,6 +60,11 @@ public class Name extends SimpleStreamableObject
|
||||
{
|
||||
if (_normal == null) {
|
||||
_normal = normalize(_name);
|
||||
// if _normal is an equals() String, ensure both point to the
|
||||
// same string for efficiency
|
||||
if (_normal.equals(_name)) {
|
||||
_normal = _name;
|
||||
}
|
||||
}
|
||||
return _normal;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user