Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
ZODB
Commits
25625878
Commit
25625878
authored
Apr 23, 2004
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
_get_cached_tid(): Python auto-overflows int to long now, so remove the
fiddly code trying to prevent OverflowError.
parent
3f00fdb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
src/ZODB/FileStorage/FileStorage.py
src/ZODB/FileStorage/FileStorage.py
+3
-8
No files found.
src/ZODB/FileStorage/FileStorage.py
View file @
25625878
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
##############################################################################
##############################################################################
"""Storage implementation using a log written to a single file.
"""Storage implementation using a log written to a single file.
$Revision: 1.1
4
$
$Revision: 1.1
5
$
"""
"""
import
base64
import
base64
...
@@ -406,19 +406,14 @@ class FileStorage(BaseStorage.BaseStorage,
...
@@ -406,19 +406,14 @@ class FileStorage(BaseStorage.BaseStorage,
if
result
is
not
None
:
if
result
is
not
None
:
self
.
_oid2tid_nhits
+=
1
self
.
_oid2tid_nhits
+=
1
# Log a msg every ~8000 tries
, and prevent overflow
.
# Log a msg every ~8000 tries.
if
self
.
_oid2tid_nlookups
&
0x1fff
==
0
:
if
self
.
_oid2tid_nlookups
&
0x1fff
==
0
:
if
self
.
_oid2tid_nlookups
>>
30
:
# In older Pythons, we may overflow if we keep it an int.
self
.
_oid2tid_nlookups
=
long
(
self
.
_oid2tid_nlookups
)
self
.
_oid2tid_nhits
=
long
(
self
.
_oid2tid_nhits
)
logger
.
log
(
BLATHER
,
logger
.
log
(
BLATHER
,
"_oid2tid size %s lookups %s hits %s rate %.1f%%"
,
"_oid2tid size %s lookups %s hits %s rate %.1f%%"
,
len
(
self
.
_oid2tid
),
len
(
self
.
_oid2tid
),
self
.
_oid2tid_nlookups
,
self
.
_oid2tid_nlookups
,
self
.
_oid2tid_nhits
,
self
.
_oid2tid_nhits
,
100.0
*
self
.
_oid2tid_nhits
/
100.0
*
self
.
_oid2tid_nhits
/
self
.
_oid2tid_nlookups
)
self
.
_oid2tid_nlookups
)
return
result
return
result
...
...
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