04-23-2012, 11:45 AM | #1 |
Enthusiast
Posts: 27
Karma: 56200
Join Date: Jul 2011
Location: California
Device: none
|
Anomaly in calibre.ebooks.metadata.book ?
I was perusing code to improve my understanding before I launched my next effort in writing a plugin.
I saw an anomaly (not a bug) in calibre.ebooks.metadata.book in base.py circa lines 653..656 in the method format_field_extended. Lines 653..654 appear to be redundant to lines 657..658. Line 655 appears to be redundant to line 659. Line 656 appears to be redundant to line 651. If my analysis is right, then removing 653..656 will save nano-seconds per month by avoiding the duplicate call to fetch cmeta. -Jesse |
04-23-2012, 02:18 PM | #2 |
creator of calibre
Posts: 43,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Fixed. Thanks.
|
Advert | |
|
04-23-2012, 09:22 PM | #3 |
creator of calibre
Posts: 43,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
On second thoughts, I think I shall hold off changing this code and wait for chaley, who wrote it to comment. That code may be the way it is to deal with composite fields that refer to other composite fields.
|
04-27-2012, 02:39 AM | #4 |
Enthusiast
Posts: 27
Karma: 56200
Join Date: Jul 2011
Location: California
Device: none
|
Agreed - it is minor enough to hold off for more complete analysis.
And if it is that way for a reason, a comment stating the reason would prevent someone else later seeing the same thing and raising the same question later. -Jesse |
04-28-2012, 08:38 AM | #5 |
Grand Sorcerer
Posts: 11,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
There is redundant code there, coming from merging two methods, adding composite fields, and some bug fixes.
Changes submitted. |
Advert | |
|
Tags |
code, efficiency, formating, gui |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Showing Metadata book descriptions from Calibre? | Avid Fan | Amazon Kindle | 5 | 02-29-2012 04:59 PM |
how to write calibre metadata to the book file in bulk? | user105 | Calibre | 7 | 01-04-2012 05:21 AM |
Remove Books anomaly? | unboggling | Calibre | 31 | 10-24-2011 08:15 PM |
strange dictionary anomaly (non-rooted) | jswinden | Nook Color & Nook Tablet | 0 | 03-23-2011 06:02 PM |
Classic Anomaly with Trook and Nook? | jhempel24 | Nook Developer's Corner | 0 | 11-28-2010 12:19 PM |