tomhughes left a comment (openstreetmap/openstreetmap-website#6379)
Putting `lock` before `find` avoids doing two reads because `find` realises the
query and returns a changeset so calling `lock!` then has to do a new select to
acquire the lock. Putting `lock` before the `find` just adds it as a modifier
on the AREL object that is then executed by `find`.
I think the point of the safe navigation operator in the other cases is to
avoid raising an exception if there was a bogus changeset ID in the XML that
doesn't exist - that will then get properly detected when creating/updating the
object by the consistency checks.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6379#issuecomment-3382546144
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/6379/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev