mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-25 20:13:10 +00:00
# housekeeping
replaced all (*) CStr / CStrW by-value params with const reference. hoo boy. please always perform this optimization (actually standard idiom) when writing the code - it takes little work, tells the next guy that the string won't be modified, and makes a large performance difference. (* where possible.. a few require other changes and will follow later) This was SVN commit r4151.
This commit is contained in:
@@ -40,7 +40,7 @@ public:
|
||||
|
||||
// Add a property (with immediate value)
|
||||
virtual void AddProperty( const CStrW& PropertyName, jsval Value ) = 0;
|
||||
virtual void AddProperty( const CStrW& PropertyName, CStrW Value ) = 0;
|
||||
virtual void AddProperty( const CStrW& PropertyName, const CStrW& Value ) = 0;
|
||||
|
||||
inline IJSObject() {}
|
||||
};
|
||||
@@ -281,7 +281,7 @@ public:
|
||||
CJSValProperty* newProp = new CJSValProperty( Value );
|
||||
m_ScriptProperties[PropertyName] = newProp;
|
||||
}
|
||||
void AddProperty( const CStrW& PropertyName, CStrW Value )
|
||||
void AddProperty( const CStrW& PropertyName, const CStrW& Value )
|
||||
{
|
||||
AddProperty( PropertyName, JSParseString( Value ) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user