mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Spped up fonts_are_identical
This commit is contained in:
parent
e77df26174
commit
bdebe91156
@ -775,10 +775,14 @@ def merge_cmaps(cmaps):
|
|||||||
|
|
||||||
|
|
||||||
def fonts_are_identical(fonts):
|
def fonts_are_identical(fonts):
|
||||||
|
sentinel = object()
|
||||||
for key in ('ToUnicode', 'Data'):
|
for key in ('ToUnicode', 'Data'):
|
||||||
all_values = {f[key] for f in fonts}
|
prev_val = sentinel
|
||||||
if len(all_values) > 1:
|
for f in fonts:
|
||||||
return False
|
val = f[key]
|
||||||
|
if prev_val is not sentinel and prev_val != val:
|
||||||
|
return False
|
||||||
|
prev_val = val
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user