mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 19:18:06 +00:00
fix(MainDb): SqlEventFilterBuilder => better code
This commit is contained in:
parent
fc3ac05c55
commit
1cbfe4e499
2 changed files with 5 additions and 7 deletions
|
|
@ -120,7 +120,7 @@ namespace Private {
|
|||
raw{ char('0' + Value / pow10(N - Index - 2) % 10)..., '\0' } {}
|
||||
|
||||
template<std::size_t... Index, typename Int = int, typename std::enable_if<IsNeg::value, Int>::type* = nullptr>
|
||||
constexpr StaticIntStringHelper(const IndexSequence<Index...> &) :
|
||||
constexpr StaticIntStringHelper (const IndexSequence<Index...> &) :
|
||||
raw{ '-', char('0' + abs(Value) / pow10(N - Index - 3) % 10)..., '\0' } {}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -138,16 +138,14 @@ struct SqlEventFilterBuilder {};
|
|||
|
||||
template<EventLog::Type Type, EventLog::Type... List>
|
||||
struct SqlEventFilterBuilder<Type, List...> {
|
||||
static constexpr Private::StaticString<1 + getIntLength(int(Type)) + sums((1 + getIntLength(int(List)))...)> get () {
|
||||
return StaticIntString<int(Type)>() + "," + SqlEventFilterBuilder<List...>::get();
|
||||
}
|
||||
static constexpr auto get () L_AUTO_RETURN(
|
||||
StaticIntString<int(Type)>() + "," + SqlEventFilterBuilder<List...>::get()
|
||||
);
|
||||
};
|
||||
|
||||
template<EventLog::Type Type>
|
||||
struct SqlEventFilterBuilder<Type> {
|
||||
static constexpr Private::StaticString<1 + getIntLength(int(Type))> get () {
|
||||
return StaticIntString<int(Type)>();
|
||||
}
|
||||
static constexpr auto get () L_AUTO_RETURN(StaticIntString<int(Type)>());
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue