Deleted Added
sdiff udiff text old ( 8959:24b06cbf2d67 ) new ( 12332:2adbc3f0f65a )
full compact
1/*
2 * Copyright (c) 2012 Google
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 171 unchanged lines hidden (view full) ---

180 * @param key The key which can later be used to look up this value.
181 * @param width How many bits of the key (from msb) should be used.
182 * @param val A pointer to the value to store in the trie.
183 * @return A Handle corresponding to this value.
184 */
185 Handle
186 insert(Key key, unsigned width, Value *val)
187 {
188 // Build a mask which masks off all the bits we don't care about.
189 Key new_mask = ~(Key)0;
190 if (width < MaxBits)
191 new_mask <<= (MaxBits - width);
192 // Use it to tidy up the key.
193 key &= new_mask;
194
195 // Walk past all the nodes this new node will be inserted after. They

--- 165 unchanged lines hidden ---