def prune_perfs(PerfCounterObject):
    l = len(PerfCounterObject)
    i = 0
    while (i < l):
        d = TranslatePerfs(PerfCounterObject[i]['ObjectName'], PerfCounterObject[i]['PerformanceCounter'])
        if (PerfCounterObject[i]['ObjectName'] in d.keys()):
            for p in PerfCounterObject[i]['PerformanceCounter']:
                if (p not in d[PerfCounterObject[i]['ObjectName']]):
                    LG().Log('INFO', (((("No match for PerformanceCounter '" + p) + "' in ") + repr(PerfCounterObject[i]['ObjectName'])) + ' in omi_mapping.json, ignoring.'))
                    PerfCounterObject[i]['PerformanceCounter'].remove(p)
            if (len(PerfCounterObject[i]['PerformanceCounter']) == 0):
                PerfCounterObject.pop(i)
                l -= 1
                i -= 1
        else:
            LG().Log('INFO', (((('No matches for ObjectName ' + repr(PerfCounterObject[i]['ObjectName'])) + ' and PerformanceCounter ') + repr(PerfCounterObject[i]['PerformanceCounter'])) + ' in omi_mapping.json, ignoring.'))
            PerfCounterObject.pop(i)
            l -= 1
            i -= 1
        i += 1
def prune_perfs(PerfCounterObject):
    l = len(PerfCounterObject)
    i = 0
    while (i < l):
        d = TranslatePerfs(PerfCounterObject[i]['ObjectName'], PerfCounterObject[i]['PerformanceCounter'])
        if (PerfCounterObject[i]['ObjectName'] in d.keys()):
            for p in PerfCounterObject[i]['PerformanceCounter']:
                if (p not in d[PerfCounterObject[i]['ObjectName']]):
                    LG().Log('INFO', (((("No match for PerformanceCounter '" + p) + "' in ") + repr(PerfCounterObject[i]['ObjectName'])) + ' in omi_mapping.json, ignoring.'))
                    PerfCounterObject[i]['PerformanceCounter'].remove(p)
            if (len(PerfCounterObject[i]['PerformanceCounter']) == 0):
                PerfCounterObject.pop(i)
                l -= 1
                i -= 1
        else:
            LG().Log('INFO', (((('No matches for ObjectName ' + repr(PerfCounterObject[i]['ObjectName'])) + ' and PerformanceCounter ') + repr(PerfCounterObject[i]['PerformanceCounter'])) + ' in omi_mapping.json, ignoring.'))
            PerfCounterObject.pop(i)
            l -= 1
            i -= 1
        i += 1