Move the FileDiff sorting into its own function.

Review Request #5495 — Created Feb. 18, 2014 and submitted

Information

Review Board
master
447bc61...

Reviewers

The FileDiff sorting used when generating the list of files in the diff
viewer was all done inside of get_diff_files(), and the way it was
designed required that we store the base name and base path of each file
in the cache, despite that data never being used after sorting that data
pre-cache.

That logic has now been moved out into a get_sorted_filediffs()
function. This handles the computation of the base name and base path,
which are only computed once per entry (as per the documentation on
sorted()'s key parameter), and are not retained after the sort
operation.

We'll be able to use this function in other places that may need to
represent lists of files.

Tested before/after with some diffs and didn't see any change in the
file listings.

Unit tests pass.

chipx86
david
  1. Ship It!

  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Loading...