File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ use "std/jule/constant"
1010use "std/jule/log"
1111use "std/jule/token"
1212use "std/jule/types"
13+ use "std/slices"
1314use "std/strings"
1415
1516// Statement type.
@@ -2442,7 +2443,7 @@ impl scopeChecker {
24422443 // Following append calls will append the group members
24432444 // to slice's selected memory block.
24442445 tn := len(self.table.Vars)
2445- self.table.Vars = growSlice (self.table.Vars, len(astv.Group))
2446+ self.table.Vars = slices::Grow (self.table.Vars, len(astv.Group))
24462447 mut group := self.table.Vars[tn : tn+len(astv.Group) : tn+len(astv.Group)]
24472448 for (i, mut v) in astv.Group {
24482449 mut cv := buildVar(v)
@@ -2904,19 +2905,4 @@ fn isValidStmtForNext2(st: Stmt): bool {
29042905 |:
29052906 ret false
29062907 }
2907- }
2908-
2909- // Increases the slice's capacity, if necessary, to guarantee space for
2910- // another n elements. After growSlice(n), at least n elements can be appended
2911- // to the slice without another allocation. If n is negative or too large to
2912- // allocate the memory, it panics.
2913- fn growSlice[S: []E, E](mut s: S, mut n: int): S {
2914- if n < 0 {
2915- panic("cannot be negative")
2916- }
2917- n -= cap(s) - len(s)
2918- if n > 0 {
2919- s = append(s[:cap(s)], make([]E, n)...)[:len(s)]
2920- }
2921- ret s
29222908}
You can’t perform that action at this time.
0 commit comments