♻️Refactor: rename getMethodINT to getMethodInt

pull/3372/head
ksw2000 2025-03-25 17:05:03 +00:00
parent daf0fdb977
commit e01ca4e2fc
5 changed files with 7 additions and 7 deletions

2
ctx.go
View File

@ -1947,7 +1947,7 @@ func (c *DefaultCtx) getBody() []byte {
}
// Methods to use with next stack.
func (c *DefaultCtx) getMethodINT() int {
func (c *DefaultCtx) getMethodInt() int {
return c.methodInt
}

View File

@ -17,7 +17,7 @@ type CustomCtx interface {
Reset(fctx *fasthttp.RequestCtx)
// Methods to use with next stack.
getMethodINT() int
getMethodInt() int
getIndexRoute() int
getTreePathHash() int
getDetectionPath() string

View File

@ -345,7 +345,7 @@ type Ctx interface {
release()
getBody() []byte
// Methods to use with next stack.
getMethodINT() int
getMethodInt() int
getIndexRoute() int
getTreePathHash() int
getDetectionPath() string

View File

@ -108,7 +108,7 @@ func (app *App) methodExist(c *DefaultCtx) bool {
methods := app.config.RequestMethods
for i := 0; i < len(methods); i++ {
// Skip original method
if c.getMethodINT() == i {
if c.getMethodInt() == i {
continue
}
// Reset stack index
@ -152,7 +152,7 @@ func (app *App) methodExistCustom(c CustomCtx) bool {
methods := app.config.RequestMethods
for i := 0; i < len(methods); i++ {
// Skip original method
if c.getMethodINT() == i {
if c.getMethodInt() == i {
continue
}
// Reset stack index

View File

@ -110,9 +110,9 @@ func (r *Route) match(detectionPath, path string, params *[maxParams]string) boo
func (app *App) nextCustom(c CustomCtx) (bool, error) { //nolint:unparam // bool param might be useful for testing
// Get stack length
tree, ok := app.treeStack[c.getMethodINT()][c.getTreePathHash()]
tree, ok := app.treeStack[c.getMethodInt()][c.getTreePathHash()]
if !ok {
tree = app.treeStack[c.getMethodINT()][0]
tree = app.treeStack[c.getMethodInt()][0]
}
lenr := len(tree) - 1