Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firestore: Remove unnecessary brace initialization in call to AlphaNum #12281

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Firestore/core/src/util/string_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class FormatArg : public absl::AlphaNum {
template <typename T,
typename = typename std::enable_if<std::is_same<bool, T>{}>::type>
FormatArg(T bool_value, internal::FormatChoice<0>)
: AlphaNum{bool_value ? "true" : "false"} {
: AlphaNum(bool_value ? "true" : "false") {
}

#if __OBJC__
Expand All @@ -91,15 +91,15 @@ class FormatArg : public absl::AlphaNum {
typename T,
typename = typename std::enable_if<objc::is_objc_pointer<T>{}>::type>
FormatArg(T object, internal::FormatChoice<1>)
: AlphaNum{MakeStringView([object description])} {
: AlphaNum(MakeStringView([object description])) {
}

/**
* Creates a FormatArg from any Objective-C Class type. Objective-C Class
* types are a special struct that aren't of a type derived from NSObject.
*/
FormatArg(Class object, internal::FormatChoice<1>)
: AlphaNum{MakeStringView(NSStringFromClass(object))} {
: AlphaNum(MakeStringView(NSStringFromClass(object))) {
}
#endif

Expand All @@ -108,7 +108,7 @@ class FormatArg : public absl::AlphaNum {
* handled specially to avoid ambiguity with generic pointers, which are
* handled differently.
*/
FormatArg(std::nullptr_t, internal::FormatChoice<2>) : AlphaNum{"null"} {
FormatArg(std::nullptr_t, internal::FormatChoice<2>) : AlphaNum("null") {
}

/**
Expand All @@ -117,7 +117,7 @@ class FormatArg : public absl::AlphaNum {
* handled differently.
*/
FormatArg(const char* string_value, internal::FormatChoice<3>)
: AlphaNum{string_value == nullptr ? "null" : string_value} {
: AlphaNum(string_value == nullptr ? "null" : string_value) {
}

/**
Expand All @@ -126,7 +126,7 @@ class FormatArg : public absl::AlphaNum {
*/
template <typename T>
FormatArg(T* pointer_value, internal::FormatChoice<4>)
: AlphaNum{absl::Hex{reinterpret_cast<uintptr_t>(pointer_value)}} {
: AlphaNum(absl::Hex(reinterpret_cast<uintptr_t>(pointer_value))) {
}

/**
Expand All @@ -135,7 +135,7 @@ class FormatArg : public absl::AlphaNum {
*/
template <typename T>
FormatArg(T&& value, internal::FormatChoice<5>)
: AlphaNum{std::forward<T>(value)} {
: AlphaNum(std::forward<T>(value)) {
}
};

Expand Down
Loading