reduce the memory impact of obiuniq.

This commit is contained in:
Eric Coissac
2024-11-27 13:30:16 +01:00
parent d29a56dcbf
commit 40fb4e9767
9 changed files with 145 additions and 8 deletions

View File

@ -20,6 +20,7 @@ type __options__ struct {
appendfile bool
compressed bool
skip_empty bool
with_quality bool
csv_id bool
csv_sequence bool
csv_quality bool
@ -57,6 +58,7 @@ func MakeOptions(setters []WithOption) Options {
appendfile: false,
compressed: false,
skip_empty: false,
with_quality: true,
csv_id: true,
csv_definition: false,
csv_count: false,
@ -133,6 +135,10 @@ func (opt Options) SkipEmptySequence() bool {
return opt.pointer.skip_empty
}
func (opt Options) ReadQualities() bool {
return opt.pointer.with_quality
}
func (opt Options) CSVId() bool {
return opt.pointer.csv_id
}
@ -241,6 +247,14 @@ func OptionsSkipEmptySequence(skip bool) WithOption {
return f
}
func OptionsReadQualities(read bool) WithOption {
f := WithOption(func(opt Options) {
opt.pointer.with_quality = read
})
return f
}
func OptionsNewFile() WithOption {
f := WithOption(func(opt Options) {
opt.pointer.appendfile = false