MCPcopy Create free account
hub / github.com/comaps/comaps / PrependCity

Method PrependCity

libs/search/result.cpp:201–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201void Result::PrependCity(string_view city)
202{
203 // It is expected that if |m_address| is not empty,
204 // it starts with the region name. Avoid duplication
205 // in the case where this region name coincides with
206 // the city name and prepend otherwise.
207 strings::SimpleTokenizer tok(m_address, ",");
208 if (tok && *tok != city)
209 m_address = std::string(city) + ", " + m_address;
210}
211
212string Result::ToStringForStats() const
213{

Callers 2

MakeResultMethod · 0.80
UNIT_TESTFunction · 0.80

Calls

no outgoing calls

Tested by 1

UNIT_TESTFunction · 0.64