aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2022-01-05 11:36:47 -0600
committerAlex Gleason <alex@alexgleason.me>2022-01-05 11:36:47 -0600
commitf9ae674a579b01849f2c5b757030c8ca8292e815 (patch)
treee5e6c6f309f03e584b7c8d049917df5b4aad1cc5
parent26b0cbfd060abd6f158aa2491dc984165d0a1d37 (diff)
downloadpleroma-f9ae674a579b01849f2c5b757030c8ca8292e815.tar.gz
Remove unused ObjectId.shift_id/2
-rw-r--r--lib/pleroma/migration_helper/object_id.ex10
-rw-r--r--test/pleroma/migration_helper/object_id_test.exs6
2 files changed, 0 insertions, 16 deletions
diff --git a/lib/pleroma/migration_helper/object_id.ex b/lib/pleroma/migration_helper/object_id.ex
index 44af99c8d..3cc487523 100644
--- a/lib/pleroma/migration_helper/object_id.ex
+++ b/lib/pleroma/migration_helper/object_id.ex
@@ -36,16 +36,6 @@ defmodule Pleroma.MigrationHelper.ObjectId do
|> Repo.update_all(set: [{field, new_id}])
end
- @doc "Shift a FlakeId by N places."
- def shift_id(flake_id, n) when is_integer(n) do
- flake_id
- |> FlakeId.from_string()
- |> FlakeId.to_integer()
- |> Kernel.+(n)
- |> FlakeId.from_integer()
- |> FlakeId.to_string()
- end
-
@doc "Generate a FlakeId from a datetime."
@spec flake_from_time(NaiveDateTime.t()) :: flake_id :: String.t()
def flake_from_time(%NaiveDateTime{} = dt) do
diff --git a/test/pleroma/migration_helper/object_id_test.exs b/test/pleroma/migration_helper/object_id_test.exs
index 45567f54a..ddd2cfbd4 100644
--- a/test/pleroma/migration_helper/object_id_test.exs
+++ b/test/pleroma/migration_helper/object_id_test.exs
@@ -6,12 +6,6 @@ defmodule Pleroma.MigrationHelper.ObjectIdTest do
use Pleroma.DataCase, async: true
alias Pleroma.MigrationHelper.ObjectId
- test "shift_id/2" do
- id = "AEma8DXGjGtUDO6Qeu"
- assert ObjectId.shift_id(id, 1) == "AEma8DXGjGtUDO6Qev"
- assert ObjectId.shift_id(id, -1) == "AEma8DXGjGtUDO6Qet"
- end
-
test "flake_from_time/1" do
now = NaiveDateTime.utc_now()
id = ObjectId.flake_from_time(now)