Skip to content

Commit

Permalink
chore: Move internal function to proper section
Browse files Browse the repository at this point in the history
  • Loading branch information
LoisSotoLopez committed Jan 24, 2024
1 parent b380a8d commit 4236188
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/ndto_generator.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,6 @@ is_valid(Prefix, #{one_of := Subschemas} = Schema) when is_list(Subschemas) ->
]
)
]

)
])
])
Expand Down
12 changes: 6 additions & 6 deletions src/ndto_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,10 @@ evaluate_conditions(FunctionName, {ConditionsType, Conditions}, EvalueMode, _IsS
"Value is not matching exactly one condition. More than one (conditions ~p and ~p) matched.",
[Second, First]
)
)
)
}}
end.

internal_evaluate_conditions(fun_call, [Fun | Rest], EvalueMode) ->
next_evaluate_condition(fun_call, Fun(), Rest, EvalueMode);
internal_evaluate_conditions(mfa_call, [{Function, Args} | Rest], EvalueMode) ->
next_evaluate_condition(mfa_call, Function(Args), Rest, EvalueMode).

-spec mfoldl(Fun, Acc, List) -> Resp when
Fun :: function(),
Acc :: term(),
Expand Down Expand Up @@ -148,6 +143,11 @@ format_properties([Head | List]) ->
%%%-----------------------------------------------------------------------------
%%% INTERNAL FUNCTIONS
%%%-----------------------------------------------------------------------------
internal_evaluate_conditions(fun_call, [Fun | Rest], EvalueMode) ->
next_evaluate_condition(fun_call, Fun(), Rest, EvalueMode);
internal_evaluate_conditions(mfa_call, [{Function, Args} | Rest], EvalueMode) ->
next_evaluate_condition(mfa_call, Function(Args), Rest, EvalueMode).

-spec next_evaluate_condition(ConditionsType, CurrentResult, Conditions, EvalueMode) -> Resp when
ConditionsType :: fun_call | mfa_call,
CurrentResult :: true | {false, term()},
Expand Down

0 comments on commit 4236188

Please sign in to comment.