Move message queue instead of copy 33/288733/3
authorEunki, Hong <eunkiki.hong@samsung.com>
Wed, 22 Feb 2023 06:55:52 +0000 (15:55 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Fri, 24 Feb 2023 04:37:36 +0000 (04:37 +0000)
Minor optimzation for message queue

Change-Id: I214367f6c7a4cce33ce4b128119476bbaf912344
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali/internal/update/queue/update-message-queue.cpp

index ba391b0..6f24a68 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -248,15 +248,13 @@ bool MessageQueue::ProcessMessages(BufferIndex updateBufferIndex)
   {
     // queueMutex must be locked whilst accessing queue
     MessageQueueMutex::ScopedLock lock(mImpl->queueMutex);
-    copiedProcessQueue = mImpl->processQueue;
 
     mImpl->sceneUpdate >>= 1;
-
     sceneUpdated = (mImpl->sceneUpdate & 0x01); // if it was previously 2, scene graph was updated.
 
     mImpl->queueWasEmpty = mImpl->processQueue.empty(); // Flag whether we processed anything
 
-    mImpl->processQueue.clear();
+    copiedProcessQueue = std::move(mImpl->processQueue); // Move message queue
   }
 
   for(auto&& buffer : copiedProcessQueue)