Skip to content

Commit

Permalink
feat: re-using existing H records in map
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Jun 11, 2024
1 parent baf542a commit 78b8206
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion igc.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ type LRecord struct {
type IGC struct {
Records []Record
BRecords []*BRecord
HRecordsByTLC map[string]Record
HRecordsByTLC map[string]*HRecord
KRecords []*KRecord
Errs []error
}
Expand Down
4 changes: 2 additions & 2 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func newParser() *parser {
func (p *parser) parse(r io.Reader) (*IGC, error) {
var records []Record
var bRecords []*BRecord
hRecordsByTLC := make(map[string]Record)
hRecordsByTLC := make(map[string]*HRecord)
var kRecords []*KRecord
var errs []error
scanner := bufio.NewScanner(r)
Expand Down Expand Up @@ -164,7 +164,7 @@ func (p *parser) parse(r io.Reader) (*IGC, error) {
}
case *HFDTERecord:
if record != nil {
hRecordsByTLC[record.TLC] = record
hRecordsByTLC[record.TLC] = &record.HRecord
p.date = record.Date
}
case *IRecord:
Expand Down

0 comments on commit 78b8206

Please sign in to comment.