mirror of https://github.com/gofiber/fiber.git
♻️Refactor: rename getMethodINT to getMethodInt
parent
daf0fdb977
commit
e01ca4e2fc
2
ctx.go
2
ctx.go
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue