mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
take strings as const&
This commit is contained in:
parent
091494c6b3
commit
4c69f45241
@ -103,15 +103,16 @@ namespace ngcore
|
||||
void operator delete[] (void * p) { aligned_free(p); }
|
||||
};
|
||||
|
||||
// Two helper functions for string checking
|
||||
inline bool StartsWith(std::string str, std::string start)
|
||||
// checks if string starts with sequence
|
||||
inline bool StartsWith(const std::string& str, const std::string& start)
|
||||
{
|
||||
if(start.size() > str.size())
|
||||
return false;
|
||||
return std::equal(start.begin(), start.end(), str.begin());
|
||||
}
|
||||
|
||||
inline bool EndsWith(std::string str, std::string end)
|
||||
// checks if string ends with sequence
|
||||
inline bool EndsWith(const std::string& str, const std::string& end)
|
||||
{
|
||||
if(end.size() > str.size())
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user