提交 33fa620d 编写于 作者: 3 3dgen

消除部分重复常量字符串

上级 72136e07
package wir
import "bytes"
/**************************************
DataSeg:
**************************************/
......@@ -13,6 +15,12 @@ func newDataSeg(start int) *DataSeg {
}
func (s *DataSeg) Append(data []byte, align int) (ptr int) {
ptr = bytes.Index(s.data, data)
if ptr != -1 {
ptr += s.start
return
}
ptr = s.Alloc(len(data), align)
s.Set(data, ptr)
return
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册