Follow-up to #10312: Fixed minor performance related issues in Yaml\Inline.
minor #10323 [Yaml] Fixed minor performance related issues in Yaml\Inline. (sun)

This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #10323).

Discussion
----------

[Yaml] Fixed minor performance related issues in Yaml\Inline.

Follow-up to #10312

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

a36fef5 Follow-up to #10312: Fixed minor performance related issues in Yaml\Inline.