mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-07 08:10:08 +00:00
Optimize calls to find*() for a single char.
The character literal overload is more efficient.
This commit is contained in:
parent
abea1a8484
commit
364e98c92d
@ -136,7 +136,7 @@ std::string base64_decode(std::string const& encoded_string, bool remove_linebre
|
||||
std::string copy(encoded_string);
|
||||
|
||||
size_t pos=0;
|
||||
while ((pos = copy.find("\n", pos)) != std::string::npos) {
|
||||
while ((pos = copy.find('\n', pos)) != std::string::npos) {
|
||||
copy.erase(pos, 1);
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ Vec3f Model::vert(int iface, int nthvert)
|
||||
void Model::load_texture(std::string filename, const char *suffix, TGAImage &img)
|
||||
{
|
||||
std::string texfile(filename);
|
||||
size_t dot = texfile.find_last_of(".");
|
||||
size_t dot = texfile.find_last_of('.');
|
||||
if (dot != std::string::npos)
|
||||
{
|
||||
texfile = texfile.substr(0, dot) + std::string(suffix);
|
||||
|
Loading…
Reference in New Issue
Block a user