Opened 16 years ago

Closed 16 years ago

#197 closed defect (fixed)

linear time membership test in loop module

Reported by: Stephen Siegel Owned by:
Priority: major Milestone: Release 1.0
Component: verify Version: 1.0
Keywords: Cc:

Description

The following code is in loop.StateFactory.java. This is not the way to tell if a set contains an element. It has time O(n) instead of O(1) (for a hash table) or O(log n) (for a binary tree).

Don't fix yet--I am still debugging.

		for (State temp : this.stateMap.values()) {
			if (temp.equals(state)) {
				return false;
			}
		}

Change History (3)

comment:1 by ywei, 16 years ago

I fixed the code and will check in after you finish debugging.

comment:2 by Stephen Siegel, 16 years ago

You should svn update and see if you get conflicts and resolve them, then check in at will.

comment:3 by ywei, 16 years ago

Resolution: fixed
Status: newclosed

Use the containsValue() method now to test membership now instead of traverse all member in the collection.

Note: See TracTickets for help on using tickets.