rename unclear variable name

This commit is contained in:
ansuz 2019-08-23 12:43:42 +02:00
parent 7642ee9584
commit a34abd748e

View file

@ -302,10 +302,8 @@ module.exports.create = function (cfg) {
* because the two actions were performed like ABba...
* the fix is to use callbacks and implement queueing for writes
* to guarantee that offset computation is always atomic with writes
TODO rename maybeMsgHash to optionalMsgHash
*/
const storeMessage = function (ctx, channel, msg, isCp, maybeMsgHash) {
const storeMessage = function (ctx, channel, msg, isCp, optionalMessageHash) {
// TODO implement a queue so that we know messages are written in order
const msgBin = new Buffer(msg + '\n', 'utf8');
@ -340,7 +338,7 @@ module.exports.create = function (cfg) {
line: ((index.line || 0) + 1)
} /*:cp_index_item*/));
}
if (maybeMsgHash) { index.offsetByHash[maybeMsgHash] = index.size; }
if (optionalMessageHash) { index.offsetByHash[optionalMessageHash] = index.size; }
index.size += msgBin.length;
}));
});