Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitec29b15

Browse files
Harmon758Byron
authored andcommitted
Remove compat.byte_ord
1 parent438d3e6 commitec29b15

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

‎git/compat.py‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333
defenc=sys.getfilesystemencoding()
3434

3535
ifPY3:
36-
defbyte_ord(b):
37-
returnb
38-
3936
defbchr(n):
4037
returnbytes([n])
4138

@@ -48,7 +45,6 @@ def mviter(d):
4845
else:
4946
ifdefenc=='ascii':
5047
defenc='utf-8'
51-
byte_ord=ord
5248
bchr=chr
5349
unicode=unicode
5450
binary_type=str

‎git/objects/fun.py‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Module with functions which are supposed to be as fast as possible"""
22
fromstatimportS_ISDIR
33
fromgit.compatimport (
4-
byte_ord,
54
safe_decode,
65
defenc,
76
xrange,
@@ -27,7 +26,7 @@ def tree_to_stream(entries, write):
2726
# END for each 8 octal value
2827

2928
# git slices away the first octal if its zero
30-
ifbyte_ord(mode_str[0])==ord_zero:
29+
ifmode_str[0]==ord_zero:
3130
mode_str=mode_str[1:]
3231
# END save a byte
3332

@@ -57,10 +56,10 @@ def tree_entries_from_data(data):
5756
# read mode
5857
# Some git versions truncate the leading 0, some don't
5958
# The type will be extracted from the mode later
60-
whilebyte_ord(data[i])!=space_ord:
59+
whiledata[i]!=space_ord:
6160
# move existing mode integer up one level being 3 bits
6261
# 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)
6463
i+=1
6564
# END while reading mode
6665

@@ -70,7 +69,7 @@ def tree_entries_from_data(data):
7069
# parse name, it is NULL separated
7170

7271
ns=i
73-
whilebyte_ord(data[i])!=0:
72+
whiledata[i]!=0:
7473
i+=1
7574
# END while not reached NULL
7675

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp