Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: Source/core/rendering/style/QuotesData.cpp

Issue 232133006: Modified to function QuotesData::equals() function to use operator overloading operator== for easy … (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch Set 5 Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/rendering/style/QuotesData.h ('k') | Source/core/rendering/style/RenderStyle.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * Copyright (C) 2011 Nokia Inc. All rights reserved. 2 * Copyright (C) 2011 Nokia Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 const String QuotesData::getCloseQuote(int index) const 57 const String QuotesData::getCloseQuote(int index) const
58 { 58 {
59 ASSERT(index >= -1); 59 ASSERT(index >= -1);
60 if (!m_quotePairs.size() || index < 0) 60 if (!m_quotePairs.size() || index < 0)
61 return emptyString(); 61 return emptyString();
62 if ((size_t)index >= m_quotePairs.size()) 62 if ((size_t)index >= m_quotePairs.size())
63 return m_quotePairs.last().second; 63 return m_quotePairs.last().second;
64 return m_quotePairs.at(index).second; 64 return m_quotePairs.at(index).second;
65 } 65 }
66 66
67 bool QuotesData::equals(const QuotesData* a, const QuotesData* b) 67 bool QuotesData::operator==(const QuotesData* a)
68 { 68 {
69 if (a == b) 69 return m_quotePairs == a->m_quotePairs;
70 return true; 70 }
71 if (!a || !b) 71
72 return false; 72 bool QuotesData::operator!=(const QuotesData* a)
73 return a->m_quotePairs == b->m_quotePairs; 73 {
74 return m_quotePairs != a->m_quotePairs;
74 } 75 }
75 76
76 } // namespace WebCore 77 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/style/QuotesData.h ('k') | Source/core/rendering/style/RenderStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698