Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Changeset 1603

Show
Ignore:
Timestamp:
08/01/05 23:27:11 (3 years ago)
Author:
nahi
Message:

avoid using Range#each for speed.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/soap/baseData.rb

    r1580 r1603  
    471471 
    472472  def each 
    473     for i in 0..(@array.length - 1) 
    474       yield(@array[i], @data[i]) 
     473    idx = 0 
     474    while idx < @array.length 
     475      yield(@array[idx], @data[idx]) 
     476      idx += 1 
    475477    end 
    476478  end 
     
    599601 
    600602  def each 
    601     for i in 0..(@array.length - 1) 
    602       yield(@array[i], @data[i]) 
     603    idx = 0 
     604    while idx < @array.length 
     605      yield(@array[idx], @data[idx]) 
     606      idx += 1 
    603607    end 
    604608  end 
     
    738742    end 
    739743 
    740     for i in 0..(idxary.size - 1) 
    741       if idxary[i] + 1 > @size[i] 
    742         @size[i] = idxary[i] + 1 
    743       end 
     744    idx = 0 
     745    while idx < idxary.size 
     746      if idxary[idx] + 1 > @size[idx] 
     747        @size[idx] = idxary[idx] + 1 
     748      end 
     749      idx += 1 
    744750    end 
    745751 
     
    816822    traverse_data(@data) do |v, *position| 
    817823      iteary = ary 
    818       for rank in 1..(position.size - 1) 
     824      rank = 1 
     825      while rank < position.size 
    819826        idx = position[rank - 1] 
    820827        if iteary[idx].nil? 
     
    823830          iteary = iteary[idx] 
    824831        end 
     832        rank += 1 
    825833      end 
    826834      if block_given? 
     
    840848  def retrieve(idxary) 
    841849    data = @data 
    842     for rank in 1..(idxary.size) 
     850    rank = 1 
     851    while rank <= idxary.size 
    843852      idx = idxary[rank - 1] 
    844853      if data[idx].nil? 
     
    847856        data = data[idx] 
    848857      end 
     858      rank += 1 
    849859    end 
    850860    data 
     
    852862 
    853863  def traverse_data(data, rank = 1) 
    854     for idx in 0..(ranksize(rank) - 1) 
     864    idx = 0 
     865    while idx < ranksize(rank) 
    855866      if rank < @rank 
    856867        traverse_data(data[idx], rank + 1) do |*v| 
     
    861872        yield(data[idx], idx) 
    862873      end 
     874      idx += 1 
    863875    end 
    864876  end 
  • trunk/lib/soap/encodingstyle/soapHandler.rb

    r1580 r1603  
    256256 
    257257  def encode_attrs(generator, ns, data, parent) 
    258     return {} if data.is_a?(SOAPReference) 
    259258    attrs = {} 
     259    return attrs if data.is_a?(SOAPReference) 
    260260 
    261261    if !parent || parent.encodingstyle != EncodingNamespace 
  • trunk/lib/soap/rpc/proxy.rb

    r1597 r1603  
    479479    def create_request_obj(names, params) 
    480480      o = Object.new 
    481       for idx in 0 ... params.length 
     481      idx = 0 
     482      while idx < params.length 
    482483        o.instance_variable_set('@' + names[idx], params[idx]) 
     484        idx += 1 
    483485      end 
    484486      o 
  • trunk/lib/soap/wsdlDriver.rb

    r1600 r1603  
    437437    def create_method_obj(names, params) 
    438438      o = Object.new 
    439       for idx in 0 ... params.length 
     439      idx = 0 
     440      while idx < params.length 
    440441        o.instance_variable_set('@' + names[idx], params[idx]) 
     442        idx += 1 
    441443      end 
    442444      o 
  • trunk/test/interopR2/SOAPBuildersInterop_R2GrB.wsdl

    r1575 r1603  
    1313  <port name="InteropTestSoapPort" 
    1414      binding="tns:InteropTestSoapBindingB"> 
    15     <soap:address 
    16         location="http://www.jin.gr.jp/~nahi/Ruby/SOAP4R/SOAPBuildersInterop/"/> 
     15    <soap:address location="http://dev.ctor.org/soapsrv"/> 
    1716  </port> 
    1817</service> 
  • trunk/test/interopR2/client.rb

    r1597 r1603  
    8282      setup_log(name) 
    8383      setup_drv(location) 
    84       setup_result_drv(name, location) 
    8584    end 
    8685 
    8786    def teardown 
    88       submit_test_result 
    8987    end 
    9088 
     
    117115          XSD::QName.new(InterfaceNS, name), soap_action, name, params) 
    118116      end 
    119     end 
    120  
    121     def setup_result_drv(name, location) 
    122       @@result_drv = RPC::Driver.new(SOAPBuildersInteropResult::Server, 
    123         SOAPBuildersInteropResult::InterfaceNS) 
    124       SOAPBuildersInteropResult::Methods.each do |method, *params| 
    125         @@result_drv.add_method(method, params) 
    126       end 
    127  
    128       client = SOAPBuildersInteropResult::Endpoint.new 
    129       client.processorName = 'SOAP4R' 
    130       client.processorVersion = '1.4' 
    131       client.uri = '210.233.24.119:*' 
    132       client.wsdl = 'Not used.' 
    133  
    134       server = SOAPBuildersInteropResult::Endpoint.new 
    135       server.endpointName = name 
    136       server.uri = location 
    137       server.wsdl = 'Not used.' 
    138  
    139       @@test_result = SOAPBuildersInteropResult::InteropResults.new( 
    140         client, server) 
    141     end 
    142  
    143     def submit_test_result 
    144       load 'soap/XMLSchemaDatatypes.rb' 
    145       @@result_drv.addResults(@@test_result) 
    146117    end 
    147118  end