Skip to content

Commit 52897f8

Browse files
tryfinallyJohnSully
authored andcommitted
replace memcpy with cctor on objects
1 parent 8bc70e9 commit 52897f8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/db.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,8 +1219,7 @@ int dbSwapDatabases(long id1, long id2) {
12191219
if (id1 < 0 || id1 >= cserver.dbnum ||
12201220
id2 < 0 || id2 >= cserver.dbnum) return C_ERR;
12211221
if (id1 == id2) return C_OK;
1222-
redisDb aux;
1223-
memcpy(&aux, &g_pserver->db[id1], sizeof(redisDb));
1222+
redisDb aux(g_pserver->db[id1]);
12241223
redisDb *db1 = &g_pserver->db[id1], *db2 = &g_pserver->db[id2];
12251224

12261225
/* Swap hash tables. Note that we don't swap blocking_keys,

0 commit comments

Comments
 (0)