File tree 2 files changed +4
-9
lines changed
2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 33
33
defenc = sys .getfilesystemencoding ()
34
34
35
35
if PY3 :
36
- def byte_ord (b ):
37
- return b
38
-
39
36
def bchr (n ):
40
37
return bytes ([n ])
41
38
@@ -48,7 +45,6 @@ def mviter(d):
48
45
else :
49
46
if defenc == 'ascii' :
50
47
defenc = 'utf-8'
51
- byte_ord = ord
52
48
bchr = chr
53
49
unicode = unicode
54
50
binary_type = str
Original file line number Diff line number Diff line change 1
1
"""Module with functions which are supposed to be as fast as possible"""
2
2
from stat import S_ISDIR
3
3
from git .compat import (
4
- byte_ord ,
5
4
safe_decode ,
6
5
defenc ,
7
6
xrange ,
@@ -27,7 +26,7 @@ def tree_to_stream(entries, write):
27
26
# END for each 8 octal value
28
27
29
28
# git slices away the first octal if its zero
30
- if byte_ord ( mode_str [0 ]) == ord_zero :
29
+ if mode_str [0 ] == ord_zero :
31
30
mode_str = mode_str [1 :]
32
31
# END save a byte
33
32
@@ -57,10 +56,10 @@ def tree_entries_from_data(data):
57
56
# read mode
58
57
# Some git versions truncate the leading 0, some don't
59
58
# The type will be extracted from the mode later
60
- while byte_ord ( data [i ]) != space_ord :
59
+ while data [i ] != space_ord :
61
60
# move existing mode integer up one level being 3 bits
62
61
# and add the actual ordinal value of the character
63
- mode = (mode << 3 ) + (byte_ord ( data [i ]) - ord_zero )
62
+ mode = (mode << 3 ) + (data [i ] - ord_zero )
64
63
i += 1
65
64
# END while reading mode
66
65
@@ -70,7 +69,7 @@ def tree_entries_from_data(data):
70
69
# parse name, it is NULL separated
71
70
72
71
ns = i
73
- while byte_ord ( data [i ]) != 0 :
72
+ while data [i ] != 0 :
74
73
i += 1
75
74
# END while not reached NULL
76
75
You can’t perform that action at this time.
0 commit comments