[Compass-ci] [PATCH v10 compass-ci 1/2] lib/matrix2.rb: refactor performance optimization