correction of several small bugs

This commit is contained in:
Eric Coissac
2024-09-03 06:08:07 -03:00
parent 373464cb06
commit 65ae82622e
22 changed files with 770 additions and 79 deletions

View File

@@ -72,8 +72,8 @@ func (s *BioSequence) HasAttribute(key string) bool {
ok := s.annotations != nil
if ok {
defer s.AnnotationsUnlock()
s.AnnotationsLock()
defer s.AnnotationsUnlock()
_, ok = s.annotations[key]
}
@@ -112,8 +112,8 @@ func (s *BioSequence) GetAttribute(key string) (interface{}, bool) {
ok := s.annotations != nil
if ok {
defer s.AnnotationsUnlock()
s.AnnotationsLock()
defer s.AnnotationsUnlock()
val, ok = s.annotations[key]
}
@@ -144,8 +144,8 @@ func (s *BioSequence) SetAttribute(key string, value interface{}) {
annot := s.Annotations()
defer s.AnnotationsUnlock()
s.AnnotationsLock()
defer s.AnnotationsUnlock()
annot[key] = value
}
@@ -205,8 +205,8 @@ func (s *BioSequence) GetFloatAttribute(key string) (float64, bool) {
// No return value.
func (s *BioSequence) DeleteAttribute(key string) {
if s.annotations != nil {
defer s.AnnotationsUnlock()
s.AnnotationsLock()
defer s.AnnotationsUnlock()
delete(s.annotations, key)
}
}