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

Side by Side Diff: client/utils/large.py

Issue 2013943002: Changing license header, again! (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: Fixed third parties Created 4 years, 7 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 | « client/utils/graph.py ('k') | client/utils/logging_utils.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 2016 The LUCI Authors. All rights reserved. 1 # Copyright 2016 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed by the Apache v2.0 license that can be 2 # Use of this source code is governed under the Apache License, Version 2.0
3 # found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 """Implements an integer set compression algorithm based on delta 5 """Implements an integer set compression algorithm based on delta
6 encoded varints, which is then deflate'd. 6 encoded varints, which is then deflate'd.
7 7
8 The algorithm is intentionally simple. 8 The algorithm is intentionally simple.
9 9
10 This only works with sorted list of integers. The resulting compression level 10 This only works with sorted list of integers. The resulting compression level
11 can be very high for monotonically increasing sets. 11 can be very high for monotonically increasing sets.
12 """ 12 """
13 13
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 val_byte = ord(d) 62 val_byte = ord(d)
63 value += (val_byte & 0x7F) * base 63 value += (val_byte & 0x7F) * base
64 if val_byte & 0x80: 64 if val_byte & 0x80:
65 base <<= 7 65 base <<= 7
66 else: 66 else:
67 out.append(value + last) 67 out.append(value + last)
68 last += value 68 last += value
69 value = 0 69 value = 0
70 base = 1 70 base = 1
71 return out 71 return out
OLDNEW
« no previous file with comments | « client/utils/graph.py ('k') | client/utils/logging_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698