mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-02-07 11:33:30 -05:00
unnecessary dict index lookup (auto-fix)
ruff 'PLR1733'
This commit is contained in:
parent
935ef37059
commit
aecc99d7c1
@ -114,7 +114,7 @@ select = [
|
||||
'E', 'F', 'I', 'W', 'INT',
|
||||
'Q', 'UP', 'YTT', 'TID', 'C4', 'COM818', 'PIE', 'RET501', 'ISC',
|
||||
'PLE', 'PLW', 'PLC',
|
||||
'PLR0402', 'PLR1711', 'PLR1716', 'PLR1722',
|
||||
'PLR0402', 'PLR1711', 'PLR1716', 'PLR1722', 'PLR1733',
|
||||
'RUF', # note: RUF can flag many unsolicited errors
|
||||
# preview rules
|
||||
'RUF051', 'RUF056', # useless dict operation
|
||||
|
||||
@ -964,7 +964,7 @@ class BooksView(TableView): # {{{
|
||||
sizes = state.get('column_sizes', {})
|
||||
for col, size in sizes.items():
|
||||
if col in cmap:
|
||||
sz = sizes[col]
|
||||
sz = size
|
||||
if sz < 3:
|
||||
sz = h.sectionSizeHint(cmap[col])
|
||||
h.resizeSection(cmap[col], sz)
|
||||
|
||||
@ -250,7 +250,7 @@ class PinTableView(TableView):
|
||||
sizes = state.get('column_sizes', {})
|
||||
for col, size in sizes.items():
|
||||
if col in cmap:
|
||||
sz = sizes[col]
|
||||
sz = size
|
||||
if sz < 3:
|
||||
sz = h.sectionSizeHint(cmap[col])
|
||||
h.resizeSection(cmap[col], sz)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user