MCPcopy Create free account
hub / github.com/boostorg/build / make0sort

Function make0sort

v2/engine/make.c:883–912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

881 */
882
883static TARGETS * make0sort( TARGETS * chain )
884{
885 PROFILE_ENTER( MAKE_MAKE0SORT );
886
887 TARGETS * result = 0;
888
889 /* Walk the current target list. */
890 while ( chain )
891 {
892 TARGETS * c = chain;
893 TARGETS * s = result;
894
895 chain = chain->next;
896
897 /* Find point s in result for c. */
898 while ( s && timestamp_cmp( &s->target->time, &c->target->time ) > 0 )
899 s = s->next;
900
901 /* Insert c in front of s (might be 0). */
902 c->next = s; /* good even if s = 0 */
903 if ( result == s ) result = c; /* new head of chain? */
904 if ( !s ) s = result; /* wrap to ensure a next */
905 if ( result != c ) s->tail->next = c; /* not head? be prev's next */
906 c->tail = s->tail; /* take on next's prev */
907 s->tail = c; /* make next's prev us */
908 }
909
910 PROFILE_EXIT( MAKE_MAKE0SORT );
911 return result;
912}
913
914
915static LIST * targets_to_update_ = L0;

Callers 1

make0Function · 0.85

Calls 1

timestamp_cmpFunction · 0.85

Tested by

no test coverage detected