@@ -15,41 +15,41 @@ func (fn Function) Equal(val Function) bool {
1515
1616// switchDictionary updates the Function, switching its indices from one
1717// dictionary to another.
18- func (ms Function ) switchDictionary (src , dst ProfilesDictionary ) error {
19- if ms .NameStrindex () > 0 {
20- if src .StringTable ().Len () < int (ms .NameStrindex ()) {
21- return fmt .Errorf ("invalid name index %d" , ms .NameStrindex ())
18+ func (fn Function ) switchDictionary (src , dst ProfilesDictionary ) error {
19+ if fn .NameStrindex () > 0 {
20+ if src .StringTable ().Len () < int (fn .NameStrindex ()) {
21+ return fmt .Errorf ("invalid name index %d" , fn .NameStrindex ())
2222 }
2323
24- idx , err := SetString (dst .StringTable (), src .StringTable ().At (int (ms .NameStrindex ())))
24+ idx , err := SetString (dst .StringTable (), src .StringTable ().At (int (fn .NameStrindex ())))
2525 if err != nil {
2626 return fmt .Errorf ("couldn't set name: %w" , err )
2727 }
28- ms .SetNameStrindex (idx )
28+ fn .SetNameStrindex (idx )
2929 }
3030
31- if ms .SystemNameStrindex () > 0 {
32- if src .StringTable ().Len () < int (ms .SystemNameStrindex ()) {
33- return fmt .Errorf ("invalid system name index %d" , ms .SystemNameStrindex ())
31+ if fn .SystemNameStrindex () > 0 {
32+ if src .StringTable ().Len () < int (fn .SystemNameStrindex ()) {
33+ return fmt .Errorf ("invalid system name index %d" , fn .SystemNameStrindex ())
3434 }
3535
36- idx , err := SetString (dst .StringTable (), src .StringTable ().At (int (ms .SystemNameStrindex ())))
36+ idx , err := SetString (dst .StringTable (), src .StringTable ().At (int (fn .SystemNameStrindex ())))
3737 if err != nil {
3838 return fmt .Errorf ("couldn't set system name: %w" , err )
3939 }
40- ms .SetSystemNameStrindex (idx )
40+ fn .SetSystemNameStrindex (idx )
4141 }
4242
43- if ms .FilenameStrindex () > 0 {
44- if src .StringTable ().Len () < int (ms .FilenameStrindex ()) {
45- return fmt .Errorf ("invalid filename index %d" , ms .FilenameStrindex ())
43+ if fn .FilenameStrindex () > 0 {
44+ if src .StringTable ().Len () < int (fn .FilenameStrindex ()) {
45+ return fmt .Errorf ("invalid filename index %d" , fn .FilenameStrindex ())
4646 }
4747
48- idx , err := SetString (dst .StringTable (), src .StringTable ().At (int (ms .FilenameStrindex ())))
48+ idx , err := SetString (dst .StringTable (), src .StringTable ().At (int (fn .FilenameStrindex ())))
4949 if err != nil {
5050 return fmt .Errorf ("couldn't set filename: %w" , err )
5151 }
52- ms .SetFilenameStrindex (idx )
52+ fn .SetFilenameStrindex (idx )
5353 }
5454
5555 return nil
0 commit comments