[前][次][番号順一覧][スレッド一覧]

ruby-changes:58966

From: Hiroshi <ko1@a...>
Date: Sat, 30 Nov 2019 08:39:52 +0900 (JST)
Subject: [ruby-changes:58966] c50d30f659 (master): Simplified ErrDimensionMismatch class

https://git.ruby-lang.org/ruby.git/commit/?id=c50d30f659

From c50d30f659ff22981444b3e4684fe9e6f2809055 Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Fri, 29 Nov 2019 17:48:43 +0900
Subject: Simplified ErrDimensionMismatch class


diff --git a/lib/matrix.rb b/lib/matrix.rb
index cf1d532..fc0e8ef 100644
--- a/lib/matrix.rb
+++ b/lib/matrix.rb
@@ -17,12 +17,10 @@ require_relative "matrix/version" https://github.com/ruby/ruby/blob/trunk/lib/matrix.rb#L17
 module ExceptionForMatrix # :nodoc:
   class ErrDimensionMismatch < StandardError
     def initialize(val = nil)
-      if val.nil?
-        super
-      elsif val.is_a?(String)
+      if val
         super(val)
       else
-        super("#{val.class.name} dimension mismatch")
+        super("Dimension mismatch")
       end
     end
   end
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]