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
9a23fabd
Commit
9a23fabd
authored
Nov 01, 2007
by
Gregory P. Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Undo revision 58533 58534 fixes. Those were a workaround for
a problem introduced by 58385.
parent
9e8c5cb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
Lib/bsddb/dbtables.py
Lib/bsddb/dbtables.py
+2
-3
No files found.
Lib/bsddb/dbtables.py
View file @
9a23fabd
...
...
@@ -360,12 +360,11 @@ class bsdTableDB :
unique
=
0
while
not
unique
:
# Generate a random 64-bit row ID string
# (note:
this code has <64 bits of
randomness
# (note:
might have <64 bits of true
randomness
# but it's plenty for our database id needs!)
# We must ensure that no null bytes are in the id value.
blist
=
[]
for
x
in
xrange
(
_rowid_str_len
):
blist
.
append
(
random
.
randint
(
1
,
255
))
blist
.
append
(
random
.
randint
(
0
,
255
))
newid
=
struct
.
pack
(
'B'
*
_rowid_str_len
,
*
blist
)
# Guarantee uniqueness by adding this key to the database
...
...
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