def filter_techniques_by_platform(tech_list, platforms):
    """Given a technique list and a platforms list, filter out techniques
       that are not part of the platforms"""

    if not platforms:
        return tech_list

    filtered_list = []
    # Map to easily find objs and avoid duplicates
    ids_for_duplicates = {}
    for obj in tech_list:
        # Do not try to find if it's already on the filtered list
        if not ids_for_duplicates.get(obj['id']):
            for platform in platforms:
                if platform in obj["x_mitre_platforms"]:
                    ids_for_duplicates[obj['id']] = True
                    filtered_list.append(obj)
                    break

    return filtered_list