Opened 2 years ago

Last modified 11 months ago

#928 in_review defect

Bibrecord: avoid calling validate_record_field_positions_global()

Reported by: jmartinm Owned by: simko
Priority: major Milestone:
Component: BibRecord Version:
Keywords: Cc:


The function validate_record_field_positions_global() in 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.

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.

Attachments (1)

0001-BibRecord-remove-field-position-validation.patch (2.0 KB) - added by jmartinm 2 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 2 years ago by jmartinm

  • Owner set to jmartinm
  • Status changed from new to assigned

comment:2 Changed 2 years ago by jmartinm

  • Status changed from assigned to in_merge

Attached patch with calls to validate_record_field_positions_global() commented out.

comment:3 Changed 11 months ago by simko

  • Owner changed from jmartinm to simko
  • Status changed from in_merge to in_review
Note: See TracTickets for help on using tickets.