Bring in an upstream fix for a performance issue in the 2.41 release. Signed-off-by: Chris Packham <judge.packham@gmail.com>