Skip to content

Commit 767f7a1

Browse files
dinordcopybara-github
authored andcommitted
internal/any_invocable: Use alias RawT consistently in InitializeStorage
The alias is defined and used in one template, while two more template arguments copy-paste the definition of the alias. PiperOrigin-RevId: 728716846 Change-Id: Ia98596fca79206b2f3954c6c6878705858c73be6
1 parent e3183f1 commit 767f7a1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

absl/functional/internal/any_invocable.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,17 +499,16 @@ class CoreImpl {
499499
// Use local (inline) storage for applicable target object types.
500500
template <class QualTRef, class... Args>
501501
void InitializeStorage(Args&&... args) {
502-
if constexpr (IsStoredLocally<RemoveCVRef<QualTRef>>()) {
503-
using RawT = RemoveCVRef<QualTRef>;
502+
using RawT = RemoveCVRef<QualTRef>;
503+
if constexpr (IsStoredLocally<RawT>()) {
504504
::new (static_cast<void*>(&state_.storage))
505505
RawT(std::forward<Args>(args)...);
506506

507507
invoker_ = LocalInvoker<SigIsNoexcept, ReturnType, QualTRef, P...>;
508508
// We can simplify our manager if we know the type is trivially copyable.
509509
InitializeLocalManager<RawT>();
510510
} else {
511-
InitializeRemoteManager<RemoveCVRef<QualTRef>>(
512-
std::forward<Args>(args)...);
511+
InitializeRemoteManager<RawT>(std::forward<Args>(args)...);
513512
// This is set after everything else in case an exception is thrown in an
514513
// earlier step of the initialization.
515514
invoker_ = RemoteInvoker<SigIsNoexcept, ReturnType, QualTRef, P...>;

0 commit comments

Comments
 (0)