From a078e810f7e653daa4172b2ed19d8f0e22e26b6f Mon Sep 17 00:00:00 2001
From: ribbon-otter <39717159+ribbon-otter@users.noreply.github.com>
Date: Sun, 1 Jun 2025 18:50:20 -0700
Subject: [PATCH] remove std::move where clang warns of pessimizing-move
 (#3080)

Co-authored-by: ribbon-otter <ribbon-otter@github.invalid>
---
 dlib/any/any.h     | 2 +-
 dlib/any/storage.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlib/any/any.h b/dlib/any/any.h
index f2db32bcaf..e48a554dc9 100644
--- a/dlib/any/any.h
+++ b/dlib/any/any.h
@@ -39,7 +39,7 @@ namespace dlib
             if (contains<T_>())
                 storage.unsafe_get<T_>() = std::forward<T>(item);
             else
-                *this = std::move(any{std::forward<T>(item)});
+                *this = any{std::forward<T>(item)};
             return *this;
         }
 
diff --git a/dlib/any/storage.h b/dlib/any/storage.h
index df0a8ea92c..0226873904 100644
--- a/dlib/any/storage.h
+++ b/dlib/any/storage.h
@@ -248,7 +248,7 @@ namespace dlib
             !*/
             {
                 if (this != &other) 
-                    *this = std::move(storage_heap{other});
+                    *this = storage_heap{other};
                 return *this;
             }
 
