1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-21 20:20:55 +00:00

delete useless if-stmt

This commit is contained in:
jianzhiyao 2020-07-26 22:37:42 +08:00
parent cfff0f3b46
commit 2386c9c80d

View File

@ -323,28 +323,20 @@ func (input *BeegoInput) SetParam(key, val string) {
// This function is used to clear parameters so they may be reset between filter
// passes.
func (input *BeegoInput) ResetParams() {
if len(input.pnames) > 0 {
input.pnames = input.pnames[:0]
}
if len(input.pvalues) > 0 {
input.pvalues = input.pvalues[:0]
}
input.pnames = input.pnames[:0]
input.pvalues = input.pvalues[:0]
}
// ResetData: reset data
func (input *BeegoInput) ResetData() {
input.dataLock.Lock()
if input.data != nil {
input.data = nil
}
input.data = nil
input.dataLock.Unlock()
}
// ResetBody: reset body
func (input *BeegoInput) ResetBody() {
if len(input.RequestBody) > 0 {
input.RequestBody = []byte{}
}
input.RequestBody = []byte{}
}
// Clear: clear all data in input