Opened 13 years ago

Closed 12 years ago

#3014 closed defect (fixed)

Bug in "dojo.collections.SortedList" replace function

Reported by: guest Owned by: Tom Trenka
Priority: high Milestone:
Component: Collections Version: 0.4.2
Keywords: collections SortedList replace Cc: cdupetit@…
Blocked By: Blocking:

Description

Hello, I've detected a bug in in dojo.collections.SortedList? replace function. When you replace an existing value, a new DictionaryEntry? is created but the q array is not updated by a build call. And when you call the forEach function you've got only the first added value.

	this.replace = function (k, v) {
		if (!items[k]) {
			this.add(k, v);
			return false;
		} else {
			items[k] = new dojo.collections.DictionaryEntry(k, v);
Add   --->              build();
Remove<---		q.sort(sorter);
			return true;
		}
	};

Kilroy

Change History (1)

comment:1 Changed 12 years ago by Tom Trenka

Resolution: fixed
Status: newclosed

(In [8763]) Fixes #3045, #3014, #2249.

Note: See TracTickets for help on using tickets.