Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
check_list_order Namespace Reference

Functions

 _functions (text)
 
 main (argv)
 

Detailed Description

Catch the doubled g_list_prepend across a repository boundary.

Splitting a cursor loop into "repository builds the list / domain post-processes it" is the
standard move of the src/database migration, and it has a standing trap: BOTH halves prepend.
Two prepends cancel, so the public function silently returns its list in the opposite order to
the single-loop version it replaced -- with byte-identical SQL, a clean build in every
configuration, and green CI. It has bitten twice:

  * dt_tag_get_images() / dt_tag_get_images_from_list(), where the repository dropped the
    reversal the callers used to do (fixed in "database: restore the list order
    dt_tag_get_images() returns");
  * dt_map_location_get_locations_by_path() and _map_location_find_images(), where the
    repository kept reverse-row order AND the caller prepended again.

The rule this enforces: a repository function that builds its result with g_list_prepend and
returns it WITHOUT reversing hands back reverse-row order, which is only correct when its
consumer passes the list straight through. If the consumer prepends again, exactly one of the
two must reverse.

Reported as a list that must stay empty -- not a ratchet. There is no legitimate instance:
where the flip is genuinely wanted, reverse in the repository and say so, so the intent is in
the code rather than in the interaction of two files.

Function Documentation

◆ _functions()

check_list_order._functions (   text)
protected
(name, body) for every function definition, brace-matched, strings and comments skipped.

Definition at line 32 of file check_list_order.py.

Referenced by main().

◆ main()

check_list_order.main (   argv)

Definition at line 65 of file check_list_order.py.

References _functions(), and main().