Using the ESP32. When I send a value to preferences.h to be written... does this value get written as well if the old value is the same as the new value? If not, should I make some logic to check this?
Could be even clearer. You are using an esp32? I can only find reference to that library for esp32, and your previous posts seem to be about esp32.
This is the Arduino forum, and esp32 is only one of many kinds of Arduino. You should always mention what hardware you are using when asking a question.
That library uses an ESP-IDF function nvs_set_i32. Looking at that page, I cannot see any mention of checking the if the value is different from the current value. So probably safest to assume it writes each time, even if the value is the same.