Skip to content

Commit ada6697

Browse files
authored
Merge branch 'main' into 59-support-orderedmaprange-callbacks-mutating-the-map
2 parents 0b45ea9 + 7198d9f commit ada6697

File tree

12 files changed

+32
-57
lines changed

12 files changed

+32
-57
lines changed

.github/workflows/codeql.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ jobs:
6464

6565
steps:
6666
- name: Harden the runner (Audit all outbound calls)
67-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
67+
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
6868
with:
6969
egress-policy: audit
7070

7171
- name: Checkout repository
72-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
72+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
7373
# Add any setup steps before running the `github/codeql-action/init` action.
7474
# This includes steps like installing compilers or runtimes (`actions/setup-node`
7575
# or others). This is typically only required for manual builds.
@@ -78,7 +78,7 @@ jobs:
7878

7979
# Initializes the CodeQL tools for scanning.
8080
- name: Initialize CodeQL
81-
uses: github/codeql-action/init@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
81+
uses: github/codeql-action/init@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11
8282
with:
8383
languages: ${{ matrix.language }}
8484
build-mode: ${{ matrix.build-mode }}
@@ -92,7 +92,7 @@ jobs:
9292
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
9393
# If this step fails, then you should remove it and run the build manually (see below)
9494
- name: Autobuild
95-
uses: github/codeql-action/autobuild@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
95+
uses: github/codeql-action/autobuild@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11
9696
# If the Autobuild fails above, remove it and uncomment the following three lines.
9797
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
9898

@@ -120,6 +120,6 @@ jobs:
120120
121121
- name: Perform CodeQL Analysis
122122
- name: Perform CodeQL Analysis
123-
uses: github/codeql-action/analyze@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
123+
uses: github/codeql-action/analyze@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11
124124
with:
125125
category: "/language:${{matrix.language}}"

.github/workflows/dependency-review.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Harden the runner (Audit all outbound calls)
20-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
20+
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
2121
with:
2222
egress-policy: audit
2323

2424
- name: 'Checkout Repository'
25-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2626
- name: 'Dependency Review'
27-
uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1
27+
uses: actions/dependency-review-action@595b5aeba73380359d98a5e087f648dbb0edce1b # v4.7.3

.github/workflows/scorecard.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ jobs:
3232

3333
steps:
3434
- name: Harden the runner (Audit all outbound calls)
35-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
35+
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
3636
with:
3737
egress-policy: audit
3838

3939
- name: "Checkout code"
40-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4141
with:
4242
persist-credentials: false
4343

@@ -73,6 +73,6 @@ jobs:
7373
# Upload the results to GitHub's code scanning dashboard (optional).
7474
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
7575
- name: "Upload to code-scanning"
76-
uses: github/codeql-action/upload-sarif@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
76+
uses: github/codeql-action/upload-sarif@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11
7777
with:
7878
sarif_file: results.sarif

.github/workflows/update.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
steps:
2323
- name: Harden the runner (Audit all outbound calls)
24-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
24+
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
2525
with:
2626
egress-policy: audit
2727

@@ -31,7 +31,7 @@ jobs:
3131
go-version: ${{ env.GO_VERSION }}
3232

3333
- name: Checkout
34-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3535

3636
- name: Update minor and patch-level dependencies
3737
run: go get -t -u ./...

.github/workflows/workflow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
OS: ubuntu-latest
1616
steps:
1717
- name: Harden the runner (Audit all outbound calls)
18-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
18+
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
1919
with:
2020
egress-policy: audit
2121

22-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2323

2424
- name: Set up Go
2525
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
@@ -31,7 +31,7 @@ jobs:
3131
run: mkdir -p coverage; go test -v -race -run=. -bench=. -benchtime=1ms -coverprofile=./coverage/cover.out -covermode=atomic ./...
3232

3333
- name: Upload coverage to Codecov
34-
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
34+
uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 # v5.5.0
3535
with:
3636
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
3737
files: ./coverage/cover.out

.idea/runConfigurations/Set_demo.xml

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ See complete listings in:
5151

5252
```go
5353
stable := true
54-
om := orderedmap.NewSlice[Key, Value](sizeHint, stable)
54+
om := orderedmap.NewSlice[Key, Value](sizeHint, stable) // OrderedMap and Countable
5555
om.Store(k, v)
5656
om.Range(func (k K, v V) bool { fmt.Println(k, v); return true })
5757
v, loaded := om.Load(k)

go.mod

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
module github.com/fgm/container
22

3-
go 1.23.10
4-
5-
toolchain go1.24.4
3+
go 1.24.6
64

75
require github.com/google/go-cmp v0.7.0
86

97
require (
10-
golang.org/x/mod v0.25.0 // indirect
11-
golang.org/x/sync v0.15.0 // indirect
12-
golang.org/x/tools v0.34.0 // indirect
8+
golang.org/x/mod v0.27.0 // indirect
9+
golang.org/x/sync v0.16.0 // indirect
10+
golang.org/x/tools v0.36.0 // indirect
1311
)
1412

1513
tool golang.org/x/tools/cmd/stringer

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
22
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
3-
golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w=
4-
golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
5-
golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8=
6-
golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
7-
golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=
8-
golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
3+
golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ=
4+
golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc=
5+
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
6+
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
7+
golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg=
8+
golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s=

orderedmap/slice.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package orderedmap
22

33
import (
44
"fmt"
5-
6-
"github.com/fgm/container"
75
)
86

97
type Slice[K comparable, V any] struct {
@@ -85,7 +83,7 @@ func (s *Slice[K, V]) Store(k K, v V) {
8583
s.store[k] = v
8684
}
8785

88-
func NewSlice[K comparable, V any](sizeHint int, stable bool) container.OrderedMap[K, V] {
86+
func NewSlice[K comparable, V any](sizeHint int, stable bool) *Slice[K, V] {
8987
s := &Slice[K, V]{
9088
stable: stable,
9189
order: make([]K, 0, sizeHint),

0 commit comments

Comments
 (0)