diff options
| author | Tyge Løvset <[email protected]> | 2021-12-15 10:45:22 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-12-15 10:45:22 +0100 |
| commit | 7f264be520123c71211967a56d2826d272694edf (patch) | |
| tree | 6afcd2ccf5ffb24fcaa2ef0be46434721b567549 /examples | |
| parent | a2671650430bf12304bead0bc9f23903f03db8a6 (diff) | |
| download | STC-modified-7f264be520123c71211967a56d2826d272694edf.tar.gz STC-modified-7f264be520123c71211967a56d2826d272694edf.zip | |
Some improvements in cvec and cpque.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/inits.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/examples/inits.c b/examples/inits.c index 43613198..386be86e 100644 --- a/examples/inits.c +++ b/examples/inits.c @@ -39,16 +39,9 @@ int main(void) c_auto (cpque_f, floats) {
float nums[] = {4.0f, 2.0f, 5.0f, 3.0f, 1.0f};
- c_forrange (i, c_arraylen(nums)) {
- cpque_f_push_back(&floats, nums[i]);
- printf("%.1f ", floats.data[i]);
- }
- puts("");
-
// PRIORITY QUEUE
- cpque_f_make_heap(&floats);
- c_apply(cpque_f, push, &floats, {40.0f, 20.0f, 50.0f, 30.0f, 10.0f});
+ c_apply_n(cpque_f, push, &floats, nums, c_arraylen(nums));
puts("\npop and show high priorites first:");
while (! cpque_f_empty(floats)) {
|
