up

A priority search queue and LRU cache.
git clone git://git.jtobin.io/up.git
Log | Files | Refs

up_qor_top.c (331B)


      1 #include "all.h"
      2 
      3 u3_noun
      4 u3qdu_qor_top(u3_noun a)
      5 {
      6   if (u3_nul == a) {
      7     return u3m_bail(c3__exit);
      8   }
      9   else {
     10     return u3k(u3t(u3t(a)));
     11   }
     12 }
     13 
     14 u3_noun
     15 u3wdu_qor_top(u3_noun cor)
     16 {
     17   u3_noun a;
     18 
     19   if (c3n == u3r_mean(cor, u3x_sam, &a, 0))
     20   {
     21     return u3m_bail(c3__exit);
     22   } else {
     23     return u3qdu_qor_top(a);
     24   }
     25 }
     26