From c31ef988c13617074959c1dad57bf121d70d1664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E5=A4=B4=E4=BA=91?= Date: Sun, 30 Nov 2025 11:06:04 +0000 Subject: [PATCH] fix(shm): remove redundant self-assignment in shm_win.cpp - Remove useless 'ii->size_ = ii->size_;' statement at line 140 - The user-requested size is already set in acquire() function - Simplify else branch to just a comment for clarity - No functional change, just code cleanup --- src/libipc/platform/win/shm_win.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/libipc/platform/win/shm_win.cpp b/src/libipc/platform/win/shm_win.cpp index 73ca08c..0b7bcc0 100755 --- a/src/libipc/platform/win/shm_win.cpp +++ b/src/libipc/platform/win/shm_win.cpp @@ -135,10 +135,7 @@ void * get_mem(id_t id, std::size_t * size) { // Opening existing shared memory ii->size_ = actual_size - sizeof(info_t); } - else { - // Should match the size we allocated in acquire - ii->size_ = ii->size_; // Keep user-requested size - } + // else: Keep user-requested size (already set in acquire) ii->mem_ = mem; if (size != nullptr) *size = ii->size_; // Initialize or increment reference counter