mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-06 21:13:17 +00:00
Simplify enum parsing
This commit is contained in:
@@ -7,10 +7,9 @@ NSString* TextAnchorToString( enum TextAnchor fw )
|
||||
|
||||
enum TextAnchor TextAnchorFromString( NSString* s )
|
||||
{
|
||||
NSInteger i;
|
||||
NSString* fw;
|
||||
for (i = 0; fw = TextAnchorStrings[i], fw != nil; i++) {
|
||||
if ([fw isEqualToString:s]) {
|
||||
const NSUInteger l = sizeof(TextAnchorStrings) / sizeof(NSString*);
|
||||
for (NSUInteger i = 0; i < l; i++) {
|
||||
if ([s isEqualToString:TextAnchorStrings[i]]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user