Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1a3b19a6
Commit
1a3b19a6
authored
Feb 02, 2003
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
long_from_binary_base(): Sped this a little by computing the # of bits
needed outside the first loop.
parent
70b02d79
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Objects/longobject.c
Objects/longobject.c
+6
-6
No files found.
Objects/longobject.c
View file @
1a3b19a6
...
...
@@ -1126,15 +1126,15 @@ long_from_binary_base(char **str, int base)
k
=
ch
-
'A'
+
10
;
if
(
k
<
0
||
k
>=
base
)
break
;
n
+=
bits_per_char
;
if
(
n
<
0
)
{
++
p
;
}
*
str
=
p
;
n
=
(
p
-
start
)
*
bits_per_char
;
if
(
n
/
bits_per_char
!=
p
-
start
)
{
PyErr_SetString
(
PyExc_ValueError
,
"long string too large to convert"
);
return
NULL
;
}
++
p
;
}
*
str
=
p
;
/* n <- # of Python digits needed, = ceiling(n/SHIFT). */
n
=
(
n
+
SHIFT
-
1
)
/
SHIFT
;
z
=
_PyLong_New
(
n
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment