<commit_before>//
//  ARRelationships.m
//  iActiveRecord
//
//  Created by <NAME> on 10.01.12.
//  Copyright (c) 2012 <EMAIL>. All rights reserved.
//

#import "NSString+lowercaseFirst.h"
#import <objc/runtime.h>


#define AR_DECIMAL_NUM(number) [NSDecimalNumber numberWithDouble: number]
#define AR_DECIMAL_STR(number_string) [NSDecimalNumber decimalNumberWithString: number_string]
#define AR_INTEGER_NUM(number) [NSNumber numberWithInt: number]
#define AR_INTEGER_STR(number_string) [number_string intValue]


#define VA_NUM_ARGS(...) VA_NUM_ARGS_IMPL(, ##__VA_ARGS__, 5,4,3,2,1,0)
#define VA_NUM_ARGS_IMPL(_0,_1,_2,_3,_4,_5,N,...) N
#define macro_dispatcher(func, ...)  macro_dispatcher_(func, VA_NUM_ARGS(__VA_ARGS__))
#define macro_dispatcher_(func, nargs) macro_dispatcher__(func, nargs)
#define macro_dispatcher__(func, nargs)  func ## nargs

#define belongs_to_imp(...) macro_dispatcher(belongs_to_imp, __VA_ARGS__)(__VA_ARGS__)
#define belongs_to_dec(...) macro_dispatcher(belongs_to_dec, __VA_ARGS__)(__VA_ARGS__)


#define belongs_to_imp3(class, getter, dependency) \
    + (ARDependency)_ar_registerBelongsTo ## class { \
        return dependency; \
    } \
    - (ActiveRecord *) getter { \
        NSString *class_name = @ ""#class ""; \
        return [self performSelector : @selector(belongsTo:) withObject : class_name]; \
    } \
    -(void)set ## class : (ActiveRecord *)aRecord { \
        NSString *aClassName = @ ""#class ""; \
        ((void(*)(id, SEL, id,id))objc_msgSend)(self, sel_getUid("setRecord:belongsTo:"), aRecord, aClassName); \
    } \
    @dynamic getter ##Id ;

#define belongs_to_dec3(class, getter, dependency) \
- (ActiveRecord *)getter; \
    -(void)set ## class : (ActiveRecord *)aRecord; \
    @property ( nonatomic,strong ) NSNumber * getter ##Id;

#define belongs_to_imp4(class, getter, key, dependency) \
    + (ARDependency)_ar_registerBelongsTo ## class { \
        return dependency; \
    } \
    -(ActiveRecord *)getter { \
        NSString *class_name = @ ""#class ""; \
        return [self performSelector : @selector(belongsTo:) withObject : class_name]; \
    } \
    -(void)set ## class : (ActiveRecord *)aRecord { \
        NSString *aClassName = @ ""#class ""; \
        ((void(*)(id, SEL, id,id))objc_msgSend)(self, sel_getUid("setRecord:belongsTo:"), aRecord, aClassName); \
    } \
    @dynamic key ;

#define belongs_to_dec4(class, getter, key, dependency) \
    -(ActiveRecord *)getter; \
    -(void)set ## class : (ActiveRecord *)aRecord; \
    @property ( nonatomic,strong ) NSNumber * key;<commit_msg>replaced usages of performSelector with objc_msgSend for performance<commit_after>//
//  ARRelationships.m
//  iActiveRecord
//
//  Created by <NAME> on 10.01.12.
//  Copyright (c) 2012 okolodev.<EMAIL>. All rights reserved.
//

#import "NSString+lowercaseFirst.h"
#import <objc/runtime.h>


#define AR_DECIMAL_NUM(number) [NSDecimalNumber numberWithDouble: number]
#define AR_DECIMAL_STR(number_string) [NSDecimalNumber decimalNumberWithString: number_string]
#define AR_INTEGER_NUM(number) [NSNumber numberWithInt: number]
#define AR_INTEGER_STR(number_string) [number_string intValue]


#define VA_NUM_ARGS(...) VA_NUM_ARGS_IMPL(, ##__VA_ARGS__, 5,4,3,2,1,0)
#define VA_NUM_ARGS_IMPL(_0,_1,_2,_3,_4,_5,N,...) N
#define macro_dispatcher(func, ...)  macro_dispatcher_(func, VA_NUM_ARGS(__VA_ARGS__))
#define macro_dispatcher_(func, nargs) macro_dispatcher__(func, nargs)
#define macro_dispatcher__(func, nargs)  func ## nargs

#define belongs_to_imp(...) macro_dispatcher(belongs_to_imp, __VA_ARGS__)(__VA_ARGS__)
#define belongs_to_dec(...) macro_dispatcher(belongs_to_dec, __VA_ARGS__)(__VA_ARGS__)


#define belongs_to_imp3(class, getter, dependency) \
    + (ARDependency)_ar_registerBelongsTo ## class { \
        return dependency; \
    } \
    - (ActiveRecord *) getter { \
        NSString *class_name = @ ""#class ""; \
        return  ((id(*)(id, SEL, id))objc_msgSend)(self, @selector(belongsTo:), class_name) ; \
    } \
    -(void)set ## class : (ActiveRecord *)aRecord { \
        NSString *aClassName = @ ""#class ""; \
        ((void(*)(id, SEL, id,id))objc_msgSend)(self, sel_getUid("setRecord:belongsTo:"), aRecord, aClassName); \
    } \
    @dynamic getter ##Id ;

#define belongs_to_dec3(class, getter, dependency) \
- (ActiveRecord *)getter; \
    -(void)set ## class : (ActiveRecord *)aRecord; \
    @property ( nonatomic,strong ) NSNumber * getter ##Id;

#define belongs_to_imp4(class, getter, key, dependency) \
    + (ARDependency)_ar_registerBelongsTo ## class { \
        return dependency; \
    } \
    -(ActiveRecord *)getter { \
        NSString *class_name = @ ""#class ""; \
        return  ((id(*)(id, SEL, id))objc_msgSend)(self, @selector(belongsTo:), class_name) ; \
    } \
    -(void)set ## class : (ActiveRecord *)aRecord { \
        NSString *aClassName = @ ""#class ""; \
        ((void(*)(id, SEL, id,id))objc_msgSend)(self, sel_getUid("setRecord:belongsTo:"), aRecord, aClassName); \
    } \
    @dynamic key ;

#define belongs_to_dec4(class, getter, key, dependency) \
    -(ActiveRecord *)getter; \
    -(void)set ## class : (ActiveRecord *)aRecord; \
    @property ( nonatomic,strong ) NSNumber * key;
{'fraction_non_alphanumeric': 0.15486217457886678, 'fraction_numerical': 0.009954058192955589, 'mean_word_length': 4.127576054955839, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4930109', 'n_tokens_mistral': 1866, 'n_tokens_neox': 1809, 'n_words': 342}