Fix comparison of String8 to char* literal
Clang (correctly) interprets
if ("." == sName)
as
if ("." == (const char*)sName)
and recognizes that comparing the pointers isn't what was meant.
With
if (sName == ".")
both clang and gcc see and use String8::operator==(const char *),
ensuring we get the wanted behavior.
Change-Id: Ide240e13214a56f6899f72de3db75dac647e6d4b
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
This commit is contained in:
@@ -238,7 +238,7 @@ private:
|
||||
*/
|
||||
bool isDotOrDDot(const struct dirent* pEntry) const {
|
||||
String8 sName(pEntry->d_name);
|
||||
return "." == sName || ".." == sName;
|
||||
return sName == "." || sName == "..";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user