Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Bibrecord: avoid calling validate_record_field_positions_global() #928

Open
jmartinm opened this Issue · 1 comment

1 participant

Javier Martin Montull
Javier Martin Montull
Collaborator

Originally on 2012-03-02

The function validate_record_field_positions_global() in bibrecord.py is only used in two places, and both are like:

error = validate_record_field_positions_global(rec)
    if error:
        # FIXME one should write a message here.
        pass

This function loops through all record tags and fields thus adding an overhead when adding or deleting fields in the bibrecord structure.

Apart from that, the function does not seem to be correct. It does check the order of the global positions correctly but not the duplication of global positions.

It uses

all_fields = []

and never updates that list so the check

if field[4] in all_fields:

does not seem to make sense.

Until the function is given a proper use we could comment out the calls to speed up adding and deleting fields to the bibrecord structure.

Javier Martin Montull jmartinm self-assigned this
Javier Martin Montull
Collaborator

Originally on 2012-03-02

Attached patch with calls to validate_record_field_positions_global() commented out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.