Browse Source

perf: move less expensive condition first

Co-authored-by: gavin <gavin18d@gmail.com>
version-14
Sagar Vora 3 years ago
committed by GitHub
parent
commit
38959637e7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      frappe/model/meta.py

+ 2
- 2
frappe/model/meta.py View File

@@ -143,8 +143,8 @@ class Meta(Document):
value = [serialize(d) for d in value] value = [serialize(d) for d in value]


if ( if (
isinstance(value, (str, int, float, datetime, list, tuple))
or (not no_nulls and value is None)
(not no_nulls and value is None)
or isinstance(value, (str, int, float, datetime, list, tuple))
): ):
out[key] = value out[key] = value




Loading…
Cancel
Save