Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/reftable/pq.h # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / reftable / pq.h` 40 lines ยท 908 bytes Raw Blame History 1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Use of this source code is governed by a BSD-style 5 * license that can be found in the LICENSE file or at 6 * https://developers.google.com/open-source/licenses/bsd 7 */ 8 9 #ifndef PQ_H 10 #define PQ_H 11 12 #include "record.h" 13 14 struct pq_entry { 15 size_t index; 16 struct reftable_record *rec; 17 }; 18 19 struct merged_iter_pqueue { 20 struct pq_entry *heap; 21 size_t len; 22 size_t cap; 23 }; 24 25 int merged_iter_pqueue_remove(struct merged_iter_pqueue *pq, struct pq_entry *out); 26 int merged_iter_pqueue_add(struct merged_iter_pqueue *pq, const struct pq_entry *e); 27 void merged_iter_pqueue_release(struct merged_iter_pqueue *pq); 28 int pq_less(struct pq_entry *a, struct pq_entry *b); 29 30 static inline struct pq_entry merged_iter_pqueue_top(struct merged_iter_pqueue pq) 31 { 32 return pq.heap[0]; 33 } 34 35 static inline int merged_iter_pqueue_is_empty(struct merged_iter_pqueue pq) 36 { 37 return pq.len == 0; 38 } 39 40 #endif