| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 } | 425 } |
| 426 | 426 |
| 427 template<typename T, typename U, typename V, typename W, typename X> | 427 template<typename T, typename U, typename V, typename W, typename X> |
| 428 bool operator==(const HashMap<T, U, V, W, X>& a, const HashMap<T, U, V, W, X
>& b) | 428 bool operator==(const HashMap<T, U, V, W, X>& a, const HashMap<T, U, V, W, X
>& b) |
| 429 { | 429 { |
| 430 if (a.size() != b.size()) | 430 if (a.size() != b.size()) |
| 431 return false; | 431 return false; |
| 432 | 432 |
| 433 typedef typename HashMap<T, U, V, W, X>::const_iterator const_iterator; | 433 typedef typename HashMap<T, U, V, W, X>::const_iterator const_iterator; |
| 434 | 434 |
| 435 const_iterator end = a.end(); | 435 const_iterator aEnd = a.end(); |
| 436 const_iterator notFound = b.end(); | 436 const_iterator bEnd = b.end(); |
| 437 for (const_iterator it = a.begin(); it != end; ++it) { | 437 for (const_iterator it = a.begin(); it != aEnd; ++it) { |
| 438 const_iterator bPos = b.find(it->key); | 438 const_iterator bPos = b.find(it->key); |
| 439 if (bPos == notFound || it->value != bPos->value) | 439 if (bPos == bEnd || it->value != bPos->value) |
| 440 return false; | 440 return false; |
| 441 } | 441 } |
| 442 | 442 |
| 443 return true; | 443 return true; |
| 444 } | 444 } |
| 445 | 445 |
| 446 template<typename T, typename U, typename V, typename W, typename X> | 446 template<typename T, typename U, typename V, typename W, typename X> |
| 447 inline bool operator!=(const HashMap<T, U, V, W, X>& a, const HashMap<T, U,
V, W, X>& b) | 447 inline bool operator!=(const HashMap<T, U, V, W, X>& a, const HashMap<T, U,
V, W, X>& b) |
| 448 { | 448 { |
| 449 return !(a == b); | 449 return !(a == b); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 vector[i] = *it; | 493 vector[i] = *it; |
| 494 } | 494 } |
| 495 | 495 |
| 496 } // namespace WTF | 496 } // namespace WTF |
| 497 | 497 |
| 498 using WTF::HashMap; | 498 using WTF::HashMap; |
| 499 | 499 |
| 500 #include "wtf/RefPtrHashMap.h" | 500 #include "wtf/RefPtrHashMap.h" |
| 501 | 501 |
| 502 #endif /* WTF_HashMap_h */ | 502 #endif /* WTF_HashMap_h */ |
| OLD | NEW |