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):
|
||||
sentinel = object()
|
||||
for key in ('ToUnicode', 'Data'):
|
||||
all_values = {f[key] for f in fonts}
|
||||
if len(all_values) > 1:
|
||||
prev_val = sentinel
|
||||
for f in fonts:
|
||||
val = f[key]
|
||||
if prev_val is not sentinel and prev_val != val:
|
||||
return False
|
||||
prev_val = val
|
||||
return True
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user