소스 검색

Merge pull request #42 from GWRon/fix_map_copy

Fix: TMap.Copy() now only copies _root if there were entries in the map
Brucey 8 년 전
부모
커밋
3b452c767b
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      map.mod/map.bmx

+ 4 - 1
map.mod/map.bmx

@@ -293,7 +293,10 @@ Type TMap
 	
 	Method Copy:TMap()
 		Local map:TMap=New TMap
-		map._root=_root.Copy( nil )
+		'avoid copying an empty map (_root = nil there), else it borks "eachin"
+		if _root <> nil
+			map._root=_root.Copy( nil )
+		endif
 		Return map
 	End Method