PutCaseExpression returns a CaseExpression to the pool
(ce *CaseExpression)
| 1155 | |
| 1156 | // PutCaseExpression returns a CaseExpression to the pool |
| 1157 | func PutCaseExpression(ce *CaseExpression) { |
| 1158 | if ce == nil { |
| 1159 | return |
| 1160 | } |
| 1161 | PutExpression(ce.Value) |
| 1162 | ce.Value = nil |
| 1163 | for i := range ce.WhenClauses { |
| 1164 | PutExpression(ce.WhenClauses[i].Condition) |
| 1165 | PutExpression(ce.WhenClauses[i].Result) |
| 1166 | } |
| 1167 | ce.WhenClauses = ce.WhenClauses[:0] |
| 1168 | PutExpression(ce.ElseClause) |
| 1169 | ce.ElseClause = nil |
| 1170 | caseExprPool.Put(ce) |
| 1171 | } |
| 1172 | |
| 1173 | // GetBetweenExpression gets a BetweenExpression from the pool |
| 1174 | func GetBetweenExpression() *BetweenExpression { |