| Commit-Queue | +1 |
defname += name.Substr(7);This is a perfectly accurate mechanical translation of the original code, but it seems to highlight a pre-existing bug!
`name` starts with the 6-character prefix "Device" (as seen in the `if` condition above).
`Substr(7)` skips the first 7 characters. For "DeviceGray" (length 10), it skips the 'G' at index 6 and returns "ray", resulting in `defname` becoming "Defaultray".
For "DeviceRGB", it results in "DefaultGB", and for "DeviceCMYK" it results in "DefaultMYK".
The intent here is clearly to look up "DefaultGray", "DefaultRGB", and "DefaultCMYK". The author of the original code likely used `7` by mistake, perhaps confusing the length of "Default" (7) with the length of "Device" (6).
Since you're modifying this line, consider fixing this by changing it to `name.Substr(6)`.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
-- Fix one suggested length botch,Can that be a separate CL?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Can that be a separate CL?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Convert some {Byte,Wide}String::Last() calls to Substr().
Gemini generated patch once human realized that many of these
less-readable expressions abound.| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |