Code like this is a typical side effect of the refactoring of old C code turned into C++.
The length of a string in a variable of type std::string is computed by the strlen function.
This method is obviously inefficient and cumbersome.
Change-Id: Ibf17a043b96b134eb8f9b671d2d0d5d64534ebe1
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
return;
}
- if (strlen (key.get_key_string ().c_str ()) >= 116) {
+ if (key.get_key_string ().length () >= 116) {
LOGW ("the length of key string is too long\n");
return;
}
check_input_resource (ic, INPUT_RESOURCE_LOCAL);
}
- if (strlen (key.get_key_string ().c_str ()) >= 116)
+ if (key.get_key_string ().length () >= 116)
return;
send_wl_key_event (ic, key, true);