[core] Switch to ankerl::unordered_dense

Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
This commit is contained in:
x7z4w
2025-11-24 17:34:56 +00:00
parent 7e561d09d3
commit 0288b97b13
282 changed files with 4385 additions and 1457 deletions

View File

@@ -18,7 +18,6 @@
#include <functional>
#include <memory>
#include <unordered_map>
#include <vector>
namespace
@@ -53,7 +52,7 @@ struct TBatchedData
jobject g_countryChangedListener = nullptr;
DECLARE_THREAD_CHECKER(g_batchingThreadChecker);
std::unordered_map<jobject, std::vector<TBatchedData>> g_batchedCallbackData;
ankerl::unordered_dense::map<jobject, std::vector<TBatchedData>> g_batchedCallbackData;
bool g_isBatched;
storage::Storage & GetStorage()

View File

@@ -320,7 +320,7 @@ JNIEXPORT jobject JNICALL Java_app_organicmaps_sdk_editor_OpeningHours_nativeCur
jclass ohStateClass = jni::GetGlobalClassRef(env, "app/organicmaps/sdk/editor/OhState");
jclass ruleStateClass = jni::GetGlobalClassRef(env, "app/organicmaps/sdk/editor/OhState$State");
static std::unordered_map<RuleState, char const *> const ruleState = {
static ankerl::unordered_dense::map<RuleState, char const *> const ruleState = {
{RuleState::Open, "Open"}, {RuleState::Closed, "Closed"}, {RuleState::Unknown, "Unknown"}};
jfieldID stateField =

View File

@@ -35,7 +35,8 @@ SOFTWARE.
#include <iterator>
#include <string>
#include <unordered_map>
#include "3party/ankerl/unordered_dense.h"
DECLARE_EXCEPTION(JniException, RootException);
@@ -151,7 +152,7 @@ public:
}
private:
std::unordered_map<std::string, jfieldID> m_fieldIds;
ankerl::unordered_dense::map<std::string, jfieldID> m_fieldIds;
};
} // namespace

View File

@@ -4,28 +4,30 @@ package app.organicmaps.sdk.bookmarks.data;
* represents the details of the socket available on a particular charging station
*
*/
public record ChargeSocketDescriptor(String type, int count, double power) {
/**
* Some charge sockets have the same visuals as other sockets, even though they are different and are tagged
* differently in OSM. This method returns the 'visual' type that should be used for the socket.
*
* @return the 'equivalent' visual style that should be used for this socket
*/
public String visualType() {
if (type.equals("typee")) {
return "schuko";
}
return type;
}
/**
* For some sockets (eg, domestic sockets), the power is usually not provided, as it is 'implicit'
*
* @return true if this socket type does not require displaying the power
*/
public Boolean ignorePower() {
return type.equals("typee") || type.equals("schuko");
public record ChargeSocketDescriptor(String type, int count, double power)
{
/**
* Some charge sockets have the same visuals as other sockets, even though they are different and are tagged
* differently in OSM. This method returns the 'visual' type that should be used for the socket.
*
* @return the 'equivalent' visual style that should be used for this socket
*/
public String visualType()
{
if (type.equals("typee"))
{
return "schuko";
}
return type;
}
/**
* For some sockets (eg, domestic sockets), the power is usually not provided, as it is 'implicit'
*
* @return true if this socket type does not require displaying the power
*/
public Boolean ignorePower()
{
return type.equals("typee") || type.equals("schuko");
}
}

View File

@@ -3,7 +3,6 @@ package app.organicmaps.sdk.editor;
import androidx.annotation.IntRange;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import app.organicmaps.sdk.editor.data.Timespan;
import app.organicmaps.sdk.editor.data.Timetable;

View File

@@ -2,16 +2,14 @@ package app.organicmaps.sdk.util;
import android.content.Context;
import android.content.res.Resources;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import app.organicmaps.sdk.R;
import java.text.DateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Locale;
import app.organicmaps.sdk.R;
public final class DateUtils
{
private DateUtils() {}
@@ -44,7 +42,7 @@ public final class DateUtils
if (days == 1)
return resources.getString(R.string.yesterday).toLowerCase();
if (days < 7)
return resources.getString(R.string.days_ago, Integer.toString(days));
return resources.getString(R.string.days_ago, Integer.toString(days));
if (days < 30)
return resources.getString(days < 14 ? R.string.week_ago : R.string.weeks_ago, Integer.toString(days / 7));
if (days < 365)