<commit_before>package decoder

import "github.com/dotdoom/goxmpp/stream"

type ElementHandler interface {
	HandleElement(stream.Wrapper)
}

type InnerXMLHandler interface {
	HandleInnerXML(stream.Wrapper) []ElementHandler
}

type InnerXML struct {
	XML []byte `xml:",innerxml"`
	xep.Registrator
}

func (self *InnerXML) HandleInnerXML(sw goxmpp.StreamWrapper) []ElementHandler {
	sw.Buffer.PutXML(self.XML)

	handlers := make([]ElementHandler)
	for token, terr := sw.Decoder.Token(); err == nil; token, terr := sw.Decoder.Token() {
		switch element, realType := token.(type); realType {
		case xml.StartElement:
			if handler, err := self.Registrator.GetHandler(elemnt.Name.Space + " " + element.Name.Local); err == nil {
				handlers = append(handlers, handler)
			}
		}
	}

	for _, handler := range handlers {
		handler.HandleElement()
	}

	return make([]ElementHandler)
}

func (self *InnerXML) HandleElement(sw goxmpp.StreamWrapper) {
	for _, element := range self.HandlerInnerXML(sw) {
		element.HandleElement(sw)
	}
}
<commit_msg>Fixed InnerXML handler (remove unnecessary code)<commit_after>package decoder

import "github.com/dotdoom/goxmpp/stream"

type ElementHandler interface {
	HandleElement(stream.Wrapper)
}

type InnerXMLHandler interface {
	HandleInnerXML(stream.Wrapper) []ElementHandler
}

type InnerXML struct {
	XML []byte `xml:",innerxml"`
	xep.Registrator
}

func (self *InnerXML) HandleInnerXML(sw goxmpp.StreamWrapper) []ElementHandler {
	sw.Buffer.PutXML(self.XML)

	handlers := make([]ElementHandler)
	for token, terr := sw.Decoder.Token(); err == nil; token, terr := sw.Decoder.Token() {
		switch element, realType := token.(type); realType {
		case xml.StartElement:
			if handler, err := self.Registrator.GetHandler(elemnt.Name.Space + " " + element.Name.Local); err == nil {
				handlers = append(handlers, handler)
			}
		}
	}

	return handlers
}

func (self *InnerXML) HandleElement(sw goxmpp.StreamWrapper) {
	for _, element := range self.HandlerInnerXML(sw) {
		element.HandleElement(sw)
	}
}

{'fraction_non_alphanumeric': 0.13208477082306555, 'fraction_numerical': 0.0, 'mean_word_length': 4.884057971014493, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3287591', 'n_tokens_mistral': 697, 'n_tokens_neox': 658, 'n_words': 144}