offset negative index by 1

This commit is contained in:
byte[] 2021-12-29 21:13:39 -05:00
parent eb80be2a5b
commit cf80b6a63b
2 changed files with 2 additions and 2 deletions

View file

@ -101,7 +101,7 @@ export class LocalAutocompleter {
if (imageCount < 0) {
// This is actually an alias, so follow it
return [ name, this.getResultAt(-imageCount)[1] ];
return [ name, this.getResultAt(-imageCount - 1)[1] ];
}
return [ name, { name, imageCount, associations } ];

View file

@ -75,7 +75,7 @@ defmodule Philomena.Autocomplete do
if not is_nil(alias_target) do
target = Map.fetch!(reference_indexes, alias_target)
<<references::binary, pos::32-little, -target::32-little>>
<<references::binary, pos::32-little, -(target + 1)::32-little>>
else
<<references::binary, pos::32-little, images_count::32-little>>
end