replace memcpy with cctor on objects

Former-commit-id: 52897f8f9a882bcdbd1e8ede6bdf24e7435f5ce8
This commit is contained in:
Muhammad Zahalqa 2020-06-13 18:26:26 +03:00 committed by John Sully
parent ec28161271
commit f024fe30f4

View File

@ -1219,8 +1219,7 @@ int dbSwapDatabases(long id1, long id2) {
if (id1 < 0 || id1 >= cserver.dbnum ||
id2 < 0 || id2 >= cserver.dbnum) return C_ERR;
if (id1 == id2) return C_OK;
redisDb aux;
memcpy(&aux, &g_pserver->db[id1], sizeof(redisDb));
redisDb aux(g_pserver->db[id1]);
redisDb *db1 = &g_pserver->db[id1], *db2 = &g_pserver->db[id2];
/* Swap hash tables. Note that we don't swap blocking_keys,