* lib/rexml/text.rb (REXML::Text#clear_cache): Extract common

cache clear code.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kou 2013-07-07 02:35:13 +00:00
parent 2114ad42da
commit afbc25c404
2 changed files with 13 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Sun Jul 7 11:34:18 2013 Kouhei Sutou <kou@cozmixng.org>
* lib/rexml/text.rb (REXML::Text#clear_cache): Extract common
cache clear code.
Sun Jul 7 11:01:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (RUBY_DTRACE_POSTPROCESS): dtrace version SUN D 1.11

View file

@ -103,7 +103,7 @@ module REXML
@raw = raw unless raw.nil?
@entity_filter = entity_filter
@normalized = @unnormalized = nil
clear_cache
if arg.kind_of? String
@string = arg.dup
@ -256,8 +256,7 @@ module REXML
# e[0].value = "<a>" # <a>&lt;a&gt;</a>
def value=( val )
@string = val.gsub( /\r\n?/, "\n" )
@unnormalized = nil
@normalized = nil
clear_cache
@raw = false
end
@ -331,6 +330,12 @@ module REXML
out << copy
end
private
def clear_cache
@normalized = nil
@unnormalized = nil
end
# Reads text, substituting entities
def Text::read_with_substitution( input, illegal=nil )
copy = input.clone