Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7488929

Browse files
committed
Simplify IsXactIsoLevelSerializable test. A cycle saved is a cycle
earned ...
1 parent 1a86e6e commit 7488929

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/include/access/xact.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/access/xact.h,v 1.71 2004/08/29 05:06:55 momjian Exp $
10+
* $PostgreSQL: pgsql/src/include/access/xact.h,v 1.72 2004/09/05 23:01:26 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -32,10 +32,10 @@ extern int DefaultXactIsoLevel;
3232
extern int XactIsoLevel;
3333

3434
/*
35-
* We only implement two distinct levels, so this is a convenience to
36-
* check which level we're really using internally.
35+
* We only implement two isolation levels internally. This macro should
36+
* be used to check which one is selected.
3737
*/
38-
#define IsXactIsoLevelSerializable ((XactIsoLevel == XACT_REPEATABLE_READ || XactIsoLevel == XACT_SERIALIZABLE))
38+
#define IsXactIsoLevelSerializable (XactIsoLevel >= XACT_REPEATABLE_READ)
3939

4040
/* Xact read-only state */
4141
extern bool DefaultXactReadOnly;

0 commit comments

Comments
 (0)