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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
4264ae40
Commit
4264ae40
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
25035527
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
trunk/src/ZODB/FileStorage/FileStorage.py
trunk/src/ZODB/FileStorage/FileStorage.py
+3
-8
No files found.
trunk/src/ZODB/FileStorage/FileStorage.py
View file @
4264ae40
...
...
@@ -13,7 +13,7 @@
##############################################################################
"""Storage implementation using a log written to a single file.
$Revision: 1.1
4
$
$Revision: 1.1
5
$
"""
import
base64
...
...
@@ -406,19 +406,14 @@ class FileStorage(BaseStorage.BaseStorage,
if
result
is
not
None
:
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
>>
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
,
"_oid2tid size %s lookups %s hits %s rate %.1f%%"
,
len
(
self
.
_oid2tid
),
self
.
_oid2tid_nlookups
,
self
.
_oid2tid_nhits
,
100.0
*
self
.
_oid2tid_nhits
/
self
.
_oid2tid_nlookups
)
100.0
*
self
.
_oid2tid_nhits
/
self
.
_oid2tid_nlookups
)
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