perf: reduce database operations when using the constant parameter in Cloud Function validation (#7892)

This commit is contained in:
dblythy
2022-03-26 15:29:39 +01:00
committed by GitHub
parent b3199d7397
commit 48bd512eeb
+1 -1
View File
@@ -738,7 +738,7 @@ async function builtInTriggerValidator(options, request, auth) {
}
if (opt.constant && request.object) {
if (request.original) {
request.object.set(key, request.original.get(key));
request.object.revert(key);
} else if (opt.default != null) {
request.object.set(key, opt.default);
}