From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 7ECC520AA0 for ; Thu, 29 Dec 2016 07:42:24 +0000 (UTC) From: Eric Wong To: mogilefs-client-public@bogomips.org Subject: [PATCH 3/3] new_file/common: simplify empty class declarations Date: Thu, 29 Dec 2016 07:42:15 +0000 Message-Id: <20161229074215.12425-4-e@80x24.org> In-Reply-To: <20161229074215.12425-1-e@80x24.org> References: <20161229074215.12425-1-e@80x24.org> List-Id: This compiles to smaller bytecode on YARV (MRI) --- lib/mogilefs/new_file/common.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/mogilefs/new_file/common.rb b/lib/mogilefs/new_file/common.rb index 44eee69..d696072 100644 --- a/lib/mogilefs/new_file/common.rb +++ b/lib/mogilefs/new_file/common.rb @@ -7,14 +7,14 @@ module MogileFS::NewFile::Common # :stopdoc: - class RetryableError < MogileFS::Error; end - class EmptyResponseError < RetryableError; end - class BadResponseError < RetryableError; end - class UnparseableResponseError < RetryableError; end + RetryableError = Class.new(MogileFS::Error) + EmptyResponseError = Class.new(RetryableError) + BadResponseError = Class.new(RetryableError) + UnparseableResponseError = Class.new(RetryableError) class NoStorageNodesError < MogileFS::Error def message; 'Unable to open socket to storage node'; end end - class NonRetryableError < MogileFS::Error; end + NonRetryableError = Class.new(MogileFS::Error) MD5_TRAILER_NODES = {} # :nodoc: # EXPERIMENTAL -- EW