Skip to content

Commit

Permalink
upgrade calcit; change max/min usages; tag 0.0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Nov 14, 2021
1 parent d243cd2 commit 8018389
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 78 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Tests
on:
push:
branches:
- master
- main
pull_request: {}

jobs:
Expand All @@ -29,10 +29,10 @@ jobs:
&& git clone https://github.com/calcit-lang/calcit-test
- name: "test"
run: cr -1
run: cr --entry test -1

- run: >
cr --emit-js -1 --entry test
&& yarn
&& yarn esbuild test.js --bundle --outfile=js-out/bundle.js --platform=node
&& node ./js-out/bundle.js
cr --emit-js -1 --entry test
&& yarn
&& yarn esbuild test.js --bundle --outfile=js-out/bundle.js --platform=node
&& node ./js-out/bundle.js
73 changes: 25 additions & 48 deletions calcit.cirru

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 10 additions & 18 deletions compact.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{} (:package |bisection-key)
:configs $ {} (:init-fn |bisection-key.main/main!) (:reload-fn |bisection-key.main/reload!)
:modules $ []
:version |0.0.9
:version |0.0.10
:entries $ {}
:test $ {} (:reload-fn |bisection-key.test/run-tests)
:modules $ [] |calcit-test/
Expand Down Expand Up @@ -333,17 +333,13 @@
&set:min $ keys dict
|get-max-key $ quote
defn get-max-key (x)
last $ sort
.to-list $ keys x
, &compare
&set:max $ keys x
|get-min-key $ quote
defn get-min-key (x)
first $ sort
.to-list $ keys x
, &compare
&set:min $ keys x
|has-nth? $ quote
defn has-nth? (x n)
< n $ count x
&< n $ count x
|key-nth $ quote
defn key-nth (x n)
if (has-nth? x n)
Expand All @@ -364,13 +360,11 @@
assert (string? base-key) "|base-key should be string"
assert (map? dict) "|dict should be a map"
let
existing-keys $ sort
.to-list $ keys dict
, &compare
keys-set $ #{} & existing-keys
keys-set $ keys dict
existing-keys $ sort (.to-list keys-set) &compare
assert (includes? keys-set base-key) "|base-key should be existed"
let
position $ .index-of existing-keys base-key
position $ index-of existing-keys base-key
bisect
if (= 0 position) min-id $ get existing-keys (dec position)
, base-key
Expand All @@ -390,13 +384,11 @@
assert (string? base-key) "|base-key should be string"
assert (map? dict) "|dict should be a map"
let
existing-keys $ sort
.to-list $ keys dict
, &compare
keys-set $ #{} & existing-keys
keys-set $ keys dict
existing-keys $ sort (.to-list keys-set) &compare
assert (.includes? keys-set base-key) "|base-key should be existed"
let
position $ .index-of existing-keys base-key
position $ index-of existing-keys base-key
bisect base-key $ if
= position $ dec (count existing-keys)
, max-id
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "0.0.9",
"version": "0.0.10",
"dependencies": {
"@calcit/procs": "^0.5.4"
"@calcit/procs": "^0.5.7"
},
"scripts": {
"watch": "cr --emit-js",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8018389

Please sign in to comment.