Skip to content

Commit df8990a

Browse files
committed
minor refactor: rename string_format to strfmt
1 parent c6fcff1 commit df8990a

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

include/CubicBezier.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ T CubicBezier<T, Dim>::get_t(const T arclen) const
112112
{
113113
if ((arclen - this->valid_length) > this->LengthTolerance || arclen < 0)
114114
{
115-
throw std::runtime_error(string_format("arc length %.3f out of range; valid length: %.3f", arclen, this->valid_length));
115+
throw std::runtime_error(strfmt("arc length %.3f out of range; valid length: %.3f", arclen, this->valid_length));
116116
}
117117

118118
const T arclen_adj = std::min<T>(arclen, this->valid_length);

include/Log.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ inline void log(LogLevel lvl, const char* msg)
5858
}
5959

6060
template<class... Args>
61-
inline void logf(LogLevel lvl, const char* fmt, Args&&... args)
61+
void logf(LogLevel lvl, const char* fmt, Args&&... args)
6262
{
63-
std::string s = string_format(fmt, std::forward<Args>(args)...);
63+
std::string s = strfmt(fmt, std::forward<Args>(args)...);
6464
log(lvl, s.c_str());
6565
}
6666

include/Utils.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,13 @@ inline std::vector<T> get_triangle_strip_outline_indices(const std::size_t num_v
276276
return out_indices;
277277
}
278278

279-
inline std::string string_format(const char* fmt)
279+
inline std::string strfmt(const char* fmt)
280280
{
281281
return fmt ? std::string(fmt) : std::string();
282282
}
283283

284284
template<class... Args, typename std::enable_if<(sizeof...(Args) > 0), int>::type = 0>
285-
std::string string_format(const char* fmt, Args&&... args)
285+
std::string strfmt(const char* fmt, Args&&... args)
286286
{
287287
const int n = std::snprintf(nullptr, 0, fmt, std::forward<Args>(args)...);
288288
if (n < 0)

src/Lane.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ LaneKey::LaneKey(std::string road_id, double lanesection_s0, int lane_id) : road
1313

1414
std::string LaneKey::to_string() const
1515
{
16-
return string_format("%s/%.17g/%d", this->road_id.c_str(), this->lanesection_s0, this->lane_id);
16+
return strfmt("%s/%.17g/%d", this->road_id.c_str(), this->lanesection_s0, this->lane_id);
1717
}
1818

1919
Lane::Lane(std::string road_id, double lanesection_s0, int id, bool level, std::string type) :

src/Road.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Vec3D Road::get_surface_pt(double s, const double t, Vec3D* vn) const
157157
const double lanesection_s0 = this->get_lanesection_s0(s);
158158
if (std::isnan(lanesection_s0))
159159
{
160-
throw std::runtime_error(string_format("cannot get road surface pt, no lane section for s %.3f, road length: %.3f", s, this->length));
160+
throw std::runtime_error(strfmt("cannot get road surface pt, no lane section for s %.3f, road length: %.3f", s, this->length));
161161
}
162162

163163
const LaneSection& lanesection = this->s_to_lanesection.at(lanesection_s0);

0 commit comments

Comments
 (0)