topic_data: Use IntDict for stream_dict.

All the callers seem to have integer stream_ids
already, either from the message object or
some sub object.

We also use clear() inside the test-only reset()
method.
This commit is contained in:
Steve Howell 2020-01-23 14:42:43 +00:00 committed by Tim Abbott
parent 055b13a7a8
commit 779a9cea22
1 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
const Dict = require('./dict').Dict;
const IntDict = require('./int_dict').IntDict;
const FoldDict = require('./fold_dict').FoldDict;
let stream_dict = new Dict(); // stream_id -> topic_history object
const stream_dict = new IntDict(); // stream_id -> topic_history object
exports.stream_has_topics = function (stream_id) {
if (!stream_dict.has(stream_id)) {
@ -201,7 +201,7 @@ exports.get_recent_names = function (stream_id) {
exports.reset = function () {
// This is only used by tests.
stream_dict = new Dict();
stream_dict.clear();
};
window.topic_data = exports;