Skip to content

Commit

Permalink
chore(examples): change AVL pager to expect a read only tree (#3673)
Browse files Browse the repository at this point in the history
Using a read only tree now that there is an interface for it would make
sense sense for the pager
  • Loading branch information
jeronimoalbi authored Feb 6, 2025
1 parent 08d29a5 commit 29c3ee6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/gno.land/p/demo/avl/pager/pager.gno
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"net/url"
"strconv"

"gno.land/p/demo/avl"
"gno.land/p/demo/avl/rotree"
"gno.land/p/demo/ufmt"
)

// Pager is a struct that holds the AVL tree and pagination parameters.
type Pager struct {
Tree avl.ITree
Tree rotree.IReadOnlyTree
PageQueryParam string
SizeQueryParam string
DefaultPageSize int
Expand All @@ -37,7 +37,7 @@ type Item struct {
}

// NewPager creates a new Pager with default values.
func NewPager(tree avl.ITree, defaultPageSize int, reversed bool) *Pager {
func NewPager(tree rotree.IReadOnlyTree, defaultPageSize int, reversed bool) *Pager {
return &Pager{
Tree: tree,
PageQueryParam: "page",
Expand Down

0 comments on commit 29c3ee6

Please sign in to comment.