<commit_before>/*!
 * initialize solver from shared library.
 */

#include <ctype.h>
#include <stdlib.h>
#include <string.h>

#include "client.h"

/*!
 * \ingroup mptLoader
 * \brief proxy type pointer
 * 
 * Get 
 * 
 * \param pr  proxy metatype information
 * \param t   target cast type
 * 
 * \return metatype proxy pointer
 */
extern void *mpt_proxy_cast(const MPT_STRUCT(proxy) *pr, int t)
{
	MPT_INTERFACE(metatype) *m = 0;
	size_t i = 0;
	
	while (pr->_types[i]) {
		if (pr->_types[i] == t) {
			return pr->_ref;
		}
		if (pr->_types[i] == MPT_ENUM(TypeMeta)) {
			m = pr->_ref;
		}
	}
	if (!m) {
		return m;
	}
	return m->_vptr->conv(m, t, &m) < 0 ? 0 : m;
}<commit_msg>fix: proxy type cast search loop<commit_after>/*!
 * initialize solver from shared library.
 */

#include <ctype.h>
#include <stdlib.h>
#include <string.h>

#include "client.h"

/*!
 * \ingroup mptLoader
 * \brief proxy type pointer
 * 
 * Get 
 * 
 * \param pr  proxy metatype information
 * \param t   target cast type
 * 
 * \return metatype proxy pointer
 */
extern void *mpt_proxy_cast(const MPT_STRUCT(proxy) *pr, int t)
{
	MPT_INTERFACE(metatype) *m = 0;
	size_t i = 0;
	int c;
	
	while ((c = pr->_types[i++]) && i < sizeof(pr->_types)) {
		if (c == t) {
			return pr->_ref;
		}
		if (c == MPT_ENUM(TypeMeta)) {
			m = pr->_ref;
		}
	}
	if (!m) {
		return m;
	}
	return m->_vptr->conv(m, t, &m) < 0 ? 0 : m;
}
{'fraction_non_alphanumeric': 0.17204301075268819, 'fraction_numerical': 0.005734767025089606, 'mean_word_length': 2.965909090909091, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1752988', 'n_tokens_mistral': 602, 'n_tokens_neox': 556, 'n_words': 152}