1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 07:30: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 // This function is used to clear parameters so they may be reset between filter
// passes. // passes.
func (input *BeegoInput) ResetParams() { func (input *BeegoInput) ResetParams() {
if len(input.pnames) > 0 {
input.pnames = input.pnames[:0] input.pnames = input.pnames[:0]
}
if len(input.pvalues) > 0 {
input.pvalues = input.pvalues[:0] input.pvalues = input.pvalues[:0]
}
} }
// ResetData: reset data // ResetData: reset data
func (input *BeegoInput) ResetData() { func (input *BeegoInput) ResetData() {
input.dataLock.Lock() input.dataLock.Lock()
if input.data != nil {
input.data = nil input.data = nil
}
input.dataLock.Unlock() input.dataLock.Unlock()
} }
// ResetBody: reset body // ResetBody: reset body
func (input *BeegoInput) ResetBody() { func (input *BeegoInput) ResetBody() {
if len(input.RequestBody) > 0 {
input.RequestBody = []byte{} input.RequestBody = []byte{}
}
} }
// Clear: clear all data in input // Clear: clear all data in input