Is it better to move this anonymous function to a real named function?
<p>I am using the following code:</p>

<pre><code>   $('#dataTable .select-topic')
        .click(function () {
            if ($(this).attr('data-list') == "N") {
                $(this).attr('data-list', 'Y')
                var topicSelectHtml = $('#TopicID')
                .clone()
                .find("optgroup:first").remove().end()
                .find("option[value$='**']").remove().end().html();
                $(this).html(topicSelectHtml);
                $(this).attr('data-clicked', 'Y')
            }
        })
        .change(function () {
            $(this).attr("title", $("option:selected", this).text());
            var type = $(this).attr('id').split('_')[1];
            updateField(entity, $(this), type);
        })
</code></pre>

<p>It's applied to a few hundred rows as each row has a select. For efficiency would it be better for me to create named functions and attach these to the click and change. If so then how could I do this for the above code?</p>
