-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unused/unneeded header macros #973
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,29 +98,29 @@ extern void ASDisplayNodeSetResizableContents(id<ASResizableContents> obj, UIIma | |
|
||
NSString *ASDisplayNodeNSStringFromUIContentMode(UIViewContentMode contentMode) | ||
{ | ||
for (int i=0; i< ARRAY_COUNT(UIContentModeDescriptionLUT); i++) { | ||
if (UIContentModeDescriptionLUT[i].contentMode == contentMode) { | ||
return UIContentModeDescriptionLUT[i].string; | ||
for (auto &e : UIContentModeDescriptionLUT) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe a better variable name as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think |
||
if (e.contentMode == contentMode) { | ||
return e.string; | ||
} | ||
} | ||
return [NSString stringWithFormat:@"%d", (int)contentMode]; | ||
} | ||
|
||
UIViewContentMode ASDisplayNodeUIContentModeFromNSString(NSString *string) | ||
{ | ||
for (int i=0; i < ARRAY_COUNT(UIContentModeDescriptionLUT); i++) { | ||
if (ASObjectIsEqual(UIContentModeDescriptionLUT[i].string, string)) { | ||
return UIContentModeDescriptionLUT[i].contentMode; | ||
for (auto &e : UIContentModeDescriptionLUT) { | ||
if (ASObjectIsEqual(e.string, string)) { | ||
return e.contentMode; | ||
} | ||
} | ||
return UIViewContentModeScaleToFill; | ||
} | ||
|
||
NSString *const ASDisplayNodeCAContentsGravityFromUIContentMode(UIViewContentMode contentMode) | ||
{ | ||
for (int i=0; i < ARRAY_COUNT(UIContentModeCAGravityLUT); i++) { | ||
if (UIContentModeCAGravityLUT[i].contentMode == contentMode) { | ||
return UIContentModeCAGravityLUT[i].string; | ||
for (auto &e : UIContentModeCAGravityLUT) { | ||
if (e.contentMode == contentMode) { | ||
return e.string; | ||
} | ||
} | ||
ASDisplayNodeCAssert(contentMode == UIViewContentModeRedraw, @"Encountered an unknown contentMode %zd. Is this a new version of iOS?", contentMode); | ||
|
@@ -140,9 +140,9 @@ UIViewContentMode ASDisplayNodeUIContentModeFromCAContentsGravity(NSString *cons | |
return cachedModes[foundCacheIndex]; | ||
} | ||
|
||
for (int i = 0; i < ARRAY_COUNT(UIContentModeCAGravityLUT); i++) { | ||
if (ASObjectIsEqual(UIContentModeCAGravityLUT[i].string, contentsGravity)) { | ||
UIViewContentMode foundContentMode = UIContentModeCAGravityLUT[i].contentMode; | ||
for (auto &e : UIContentModeCAGravityLUT) { | ||
if (ASObjectIsEqual(e.string, contentsGravity)) { | ||
UIViewContentMode foundContentMode = e.contentMode; | ||
|
||
if (currentCacheIndex < ContentModeCacheSize) { | ||
// Cache the input value. This is almost always a different pointer than in our LUT and will frequently | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not pretty sure if we compile Texture with C++14 at the moment as you mention in the description, that said I think it was introduced in C++11 though. Can you double check when it was introduced and if 14 what we are building with please. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep this is from
c++11
but glad I double-checked.