Пример #1
0
// Save persists the pattern.
func (s *RBMHSequence) Save(ls *persist.LoadSaver) {
	ls.SaveByte(rbmhLoader)
	ls.SaveBytes(s.Seq)
	for _, v := range s.Shift {
		ls.SaveSmallInt(v)
	}
}
Пример #2
0
func (ss *seqSet) save(ls *persist.LoadSaver) {
	ls.SaveSmallInt(len(ss.set))
	for _, v := range ss.set {
		ls.SaveBigInts(v.MaxOffsets)
		ls.SaveSmallInt(len(v.Choices))
		for _, w := range v.Choices {
			ls.SaveSmallInt(len(w))
			for _, x := range w {
				ls.SaveBytes(x)
			}
		}
	}
	ls.SaveInts(ss.testTreeIndex)
}
Пример #3
0
func (r Range) Save(ls *persist.LoadSaver) {
	ls.SaveByte(rangeLoader)
	ls.SaveBytes(r.From)
	ls.SaveBytes(r.To)
}
Пример #4
0
// Save persists the pattern.
func (s Sequence) Save(ls *persist.LoadSaver) {
	ls.SaveByte(sequenceLoader)
	ls.SaveBytes(s)
}