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

Side by Side Diff: Source/core/dom/shadow/ContentDistribution.cpp

Issue 23464095: WTF::notFound looks too much like a local variable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/TreeScope.cpp ('k') | Source/core/editing/InputMethodController.h » ('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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 ASSERT(!isActiveInsertionPoint(node.get())); 42 ASSERT(!isActiveInsertionPoint(node.get()));
43 size_t size = m_nodes.size(); 43 size_t size = m_nodes.size();
44 m_indices.set(node.get(), size); 44 m_indices.set(node.get(), size);
45 m_nodes.append(node); 45 m_nodes.append(node);
46 } 46 }
47 47
48 size_t ContentDistribution::find(const Node* node) const 48 size_t ContentDistribution::find(const Node* node) const
49 { 49 {
50 HashMap<const Node*, size_t>::const_iterator it = m_indices.find(node); 50 HashMap<const Node*, size_t>::const_iterator it = m_indices.find(node);
51 if (it == m_indices.end()) 51 if (it == m_indices.end())
52 return notFound; 52 return kNotFound;
53 53
54 return it.get()->value; 54 return it.get()->value;
55 } 55 }
56 56
57 Node* ContentDistribution::nextTo(const Node* node) const 57 Node* ContentDistribution::nextTo(const Node* node) const
58 { 58 {
59 size_t index = find(node); 59 size_t index = find(node);
60 if (index == notFound || index + 1 == size()) 60 if (index == kNotFound || index + 1 == size())
61 return 0; 61 return 0;
62 return at(index + 1).get(); 62 return at(index + 1).get();
63 } 63 }
64 64
65 Node* ContentDistribution::previousTo(const Node* node) const 65 Node* ContentDistribution::previousTo(const Node* node) const
66 { 66 {
67 size_t index = find(node); 67 size_t index = find(node);
68 if (index == notFound || !index) 68 if (index == kNotFound || !index)
69 return 0; 69 return 0;
70 return at(index - 1).get(); 70 return at(index - 1).get();
71 } 71 }
72 72
73 } // namespace WebCore 73 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/TreeScope.cpp ('k') | Source/core/editing/InputMethodController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698