<commit_before>/*
 * Copyright 2010 2011 2012 2014 2015 <NAME> <<EMAIL>>
 * Copyright 2013 2014 2015 <NAME> <<EMAIL>>
 * See COPYING for terms of redistribution.
 */

#include <jive/vsdg/resource.h>

#include <sstream>

#include <jive/internal/compiler.h>
#include <jive/util/list.h>
#include <jive/vsdg/basetype.h>
#include <jive/vsdg/graph.h>

namespace jive {

resource_class::~resource_class()
{}

resource_name::~resource_name()
{}

}

static inline size_t
jive_ptr_hash(const void * ptr)
{
	/* FIXME: hm, ideally I would like to "rotate" instead of "shifting"... */
	size_t hash = (size_t) ptr;
	hash ^= (hash >> 20) ^ (hash >> 12);
	return hash ^ (hash >> 7) ^ (hash >> 4);
}

const jive::resource_class *
jive_resource_class_union(const jive::resource_class * self, const jive::resource_class * other)
{
	for(;;) {
		if (self == other) return self;
		if (self->depth() > other->depth())
			self = self->parent();
		else
			other = other->parent();
	}
}

const jive::resource_class *
jive_resource_class_intersection(const jive::resource_class * self,
	const jive::resource_class * other)
{<commit_msg>vsdg: remove unused jive_ptr_hash function<commit_after>/*
 * Copyright 2010 2011 2012 2014 2015 <NAME> <<EMAIL>>
 * Copyright 2013 2014 2015 <NAME> <<EMAIL>>
 * See COPYING for terms of redistribution.
 */

#include <jive/vsdg/resource.h>

#include <sstream>

#include <jive/internal/compiler.h>
#include <jive/util/list.h>
#include <jive/vsdg/basetype.h>
#include <jive/vsdg/graph.h>

namespace jive {

resource_class::~resource_class()
{}

resource_name::~resource_name()
{}

}

const jive::resource_class *
jive_resource_class_union(const jive::resource_class * self, const jive::resource_class * other)
{
	for(;;) {
		if (self == other) return self;
		if (self->depth() > other->depth())
			self = self->parent();
		else
			other = other->parent();
	}
}

const jive::resource_class *
jive_resource_class_intersection(const jive::resource_class * self,
	const jive::resource_class * other)
{
{'fraction_non_alphanumeric': 0.15568862275449102, 'fraction_numerical': 0.03493013972055888, 'mean_word_length': 4.9144542772861355, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 45, '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': '2715503', 'n_tokens_mistral': 808, 'n_tokens_neox': 722, 'n_words': 170}