OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 3 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 # | 6 # |
7 | 7 |
8 """ | 8 """ |
9 Responsible for generating the testing decoders based on | 9 Responsible for generating the testing decoders based on |
10 parsed table representations. | 10 parsed table representations. |
11 """ | 11 """ |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 values, to its corresponding index. This is done to reduce the | 1007 values, to its corresponding index. This is done to reduce the |
1008 number of compares to find the index, speeding up code | 1008 number of compares to find the index, speeding up code |
1009 generation. | 1009 generation. |
1010 """ | 1010 """ |
1011 lookup_map = {} | 1011 lookup_map = {} |
1012 index = 0 | 1012 index = 0 |
1013 for v in values: | 1013 for v in values: |
1014 lookup_map[dgen_core.neutral_repr(v)] = index | 1014 lookup_map[dgen_core.neutral_repr(v)] = index |
1015 index += 1 | 1015 index += 1 |
1016 return lookup_map | 1016 return lookup_map |
OLD | NEW |