浏览代码

Fixed some strange constructions and mapped them to easier to understand ones

Yentl Van Tendeloo 8 年之前
父节点
当前提交
da72df1862
共有 2 个文件被更改,包括 4 次插入3 次删除
  1. 3 2
      bootstrap/core_algorithm.alc
  2. 1 1
      bootstrap/random.alc

+ 3 - 2
bootstrap/core_algorithm.alc

@@ -305,9 +305,10 @@ Boolean function pm_finished(worklist : Element, pm : String):
 	i = 0
 	cnt = set_len(finished)
 
-	while (i < cnt):
+	worklist = set_copy(worklist)
+	while (set_len(worklist) > 0):
 		// Check each finished element individually
-		if (set_in(finished, dict_read(read_edge_dst(read_out(worklist, i)), 0))):
+		if (set_in(finished, set_pop(worklist))):
 			return True!
 		i = i + 1
 

+ 1 - 1
bootstrap/random.alc

@@ -29,4 +29,4 @@ Element function random_choice(list : Element):
 	if (list_len(list) == 0):
 		return read_root()!
 	else:
-		return read_edge_dst(read_out(list, random_interval(0, list_len(list) - 1)))!
+		return list_read(list, random_interval(0, list_len(list) - 1))!