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

Side by Side Diff: sandbox/linux/seccomp-bpf/codegen.cc

Issue 826573002: Revert "Update legacy Tuple-using code." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 12 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 | « sandbox/linux/seccomp-bpf/codegen.h ('k') | testing/generate_gmock_mutant.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sandbox/linux/seccomp-bpf/codegen.h" 5 #include "sandbox/linux/seccomp-bpf/codegen.h"
6 6
7 #include <linux/filter.h> 7 #include <linux/filter.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <utility> 10 #include <utility>
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 138 }
139 139
140 size_t CodeGen::Offset(Node target) const { 140 size_t CodeGen::Offset(Node target) const {
141 CHECK_LT(target, program_.size()) << "Bogus offset target node"; 141 CHECK_LT(target, program_.size()) << "Bogus offset target node";
142 return (program_.size() - 1) - target; 142 return (program_.size() - 1) - target;
143 } 143 }
144 144
145 // TODO(mdempsky): Move into a general base::Tuple helper library. 145 // TODO(mdempsky): Move into a general base::Tuple helper library.
146 bool CodeGen::MemoKeyLess::operator()(const MemoKey& lhs, 146 bool CodeGen::MemoKeyLess::operator()(const MemoKey& lhs,
147 const MemoKey& rhs) const { 147 const MemoKey& rhs) const {
148 if (get<0>(lhs) != get<0>(rhs)) 148 if (lhs.a != rhs.a)
149 return get<0>(lhs) < get<0>(rhs); 149 return lhs.a < rhs.a;
150 if (get<1>(lhs) != get<1>(rhs)) 150 if (lhs.b != rhs.b)
151 return get<1>(lhs) < get<1>(rhs); 151 return lhs.b < rhs.b;
152 if (get<2>(lhs) != get<2>(rhs)) 152 if (lhs.c != rhs.c)
153 return get<2>(lhs) < get<2>(rhs); 153 return lhs.c < rhs.c;
154 if (get<3>(lhs) != get<3>(rhs)) 154 if (lhs.d != rhs.d)
155 return get<3>(lhs) < get<3>(rhs); 155 return lhs.d < rhs.d;
156 return false; 156 return false;
157 } 157 }
158 158
159 } // namespace sandbox 159 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/linux/seccomp-bpf/codegen.h ('k') | testing/generate_gmock_mutant.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698