Don't generate unnecessary ID's on divert

This commit is contained in:
Ville Skyttä 2016-09-14 15:32:21 +03:00 committed by Clebert Suconic
parent 061ca9ce50
commit 056920e6ab
1 changed files with 1 additions and 2 deletions

View File

@ -83,12 +83,11 @@ public class DivertImpl implements Divert {
logger.trace("Diverting message " + message + " into " + this);
}
long id = storageManager.generateID();
ServerMessage copy = null;
// Shouldn't copy if it's not routed anywhere else
if (!forwardAddress.equals(message.getAddress())) {
long id = storageManager.generateID();
copy = message.copy(id);
// This will set the original MessageId, and the original address