mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Use std::map/set instead of C arrays
These types come with a find() method and avoids having to use helper functions to get the begin/end of the array (for linear search).
This commit is contained in:
@@ -362,8 +362,8 @@ OAK_DEBUG_VAR(HTMLOutput_JSShellCommand);
|
||||
+ (BOOL)isKeyExcludedFromWebScript:(char const*)name
|
||||
{
|
||||
D(DBF_HTMLOutput_JSShellCommand, bug("%s\n", name););
|
||||
static std::string const PublicProperties[] = { "outputString", "errorString", "onreadoutput", "onreaderror" };
|
||||
return !oak::contains(beginof(PublicProperties), endof(PublicProperties), name);
|
||||
static std::set<std::string> const PublicProperties = { "outputString", "errorString", "onreadoutput", "onreaderror" };
|
||||
return PublicProperties.find(name) == PublicProperties.end();
|
||||
}
|
||||
|
||||
+ (NSString*)webScriptNameForKey:(char const*)name
|
||||
@@ -374,8 +374,8 @@ OAK_DEBUG_VAR(HTMLOutput_JSShellCommand);
|
||||
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
|
||||
{
|
||||
D(DBF_HTMLOutput_JSShellCommand, bug("%s\n", (char const*)aSelector););
|
||||
static std::string const PublicMethods[] = { "cancelCommand", "writeToInput:", "closeInput" };
|
||||
return !oak::contains(beginof(PublicMethods), endof(PublicMethods), (char const*)aSelector);
|
||||
static std::set<SEL> const PublicMethods = { @selector(cancelCommand), @selector(writeToInput:), @selector(closeInput) };
|
||||
return PublicMethods.find(aSelector) == PublicMethods.end();
|
||||
}
|
||||
|
||||
+ (NSString*)webScriptNameForSelector:(SEL)aSelector
|
||||
|
||||
Reference in New Issue
Block a user