Compare two keys for equality, taking into account the setting for trailing spaces.
It is assumed that preprocess_key has already been applied to both keys before calling this function. This allows us to avoid redundant lowercasing and trimming of the keys.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(json_hash_table), | intent(in) | :: | me | |||
| character(kind=CK, len=*), | intent(in) | :: | key1 | |||
| character(kind=CK, len=*), | intent(in) | :: | key2 |
function keys_equal(me, key1, key2) result(equal) class(json_hash_table), intent(in) :: me character(kind=CK,len=*), intent(in) :: key1 character(kind=CK,len=*), intent(in) :: key2 logical(LK) :: equal if (me%trailing_spaces_significant) then ! if trailing spaces are significant, then the keys ! must be equal in length equal = len(key1) == len(key2) if (.not. equal) return end if equal = key1 == key2 end function keys_equal