Mercurial > projects > dwt2
diff base/src/java/util/HashMap.d @ 112:9f4c18c268b2
Update to compile and execute with dmd 2.052.
author | kntroh |
---|---|
date | Wed, 16 Mar 2011 21:53:53 +0900 |
parents | 0b015f5925d8 |
children | 536e43f63c81 |
line wrap: on
line diff
--- a/base/src/java/util/HashMap.d Sat Nov 13 14:15:51 2010 +0100 +++ b/base/src/java/util/HashMap.d Wed Mar 16 21:53:53 2011 +0900 @@ -9,25 +9,24 @@ version(Tango){ static import tango.util.container.HashMap; -} else { // Phobos -} - -private struct ObjRef { - Object obj; - static ObjRef opCall( Object obj ){ - ObjRef res; - res.obj = obj; - return res; + private struct ObjRef { + Object obj; + static ObjRef opCall( Object obj ){ + ObjRef res; + res.obj = obj; + return res; + } + public hash_t toHash(){ + return obj is null ? 0 : obj.toHash(); + } + public equals_t opEquals( ObjRef other ){ + return obj is null ? other.obj is null : obj.opEquals( other.obj ); + } + public equals_t opEquals( Object other ){ + return obj is null ? other is null : obj.opEquals( other ); + } } - public hash_t toHash(){ - return obj is null ? 0 : obj.toHash(); - } - public equals_t opEquals( ObjRef other ){ - return obj is null ? other.obj is null : obj.opEquals( other.obj ); - } - public equals_t opEquals( Object other ){ - return obj is null ? other is null : obj.opEquals( other ); - } +} else { // Phobos } class HashMap : Map {